At the next meeting of the rearmament commission, another general spoke in favor of technical innovations, including a new method of displaying numbers using segment indicators.

He explained that the designers have improved the counting device so that display errors can now be easily detected. According to him, the device is now equipped with a check indicator, which displays the last digit of the sum of the digits of the shown number. For example, for the result , the check digit will be (9+8+7=24, check digit ). Moreover, to improve reliability, this indication is made in the old way, which eliminates the possibility of distortion. The fact that the designers initially considered such improvement pointless and introduced it only after long persuasions was tactfully omitted by the innovative general.
The retrograde general immediately objected that this innovation does not protect against error, giving the number as an example. With a single-segment error (that is, when one required segment does not light up or, on the contrary, one unnecessary segment lights up) in two digits, it becomes , and the check counter displays , which creates the illusion of correctness for the operator. If more than two digits are distorted, there are even more opportunities for errors.
You are to write a program which, given a number, determines whether a distortion like this can occur due to a display error of no more than one segment per digit, for which the check indicator does not detect the error. (Distortions that produce insignificant zeros or non-digit symbols are not considered.)
The first line contains a non-negative integer under investigation for the possibility of distortion, 0 \le N \le 10^{1000}.
Output the word YES or NO depending on whether the described distortion is possible.
Example 1