We say that a natural number is upward if its digits fulfill the following property: on the right of a 0 can only be a 1, on the right of a 1 can only be a 2, on the right of a 2 can only be a 3, …, on the right of a 8 can only be a 9 and on the right of a 9 can only be a 0. For instance, 34567 and 8901 are upward, but 1223 and 245 are not.
Your task is to write a program that, given a sequence of natural numbers, indicates if this contains two or more consecutive upward numbers.
Your program must include the function
that indicates if a natural number n is upward.
Input
The input is a sequence of natural numbers.
Output
If the input contains two upward consecutive numbers, your program must print “YES” in a line; otherwise print “NO” in a line.
© Jutge.org, 2006–2024
Input
1234 4321 4554 2345 8901 123 6784
Output
YES
Input
Output
NO
Input
90 0
Output
YES