|시간 제한||메모리 제한||제출||정답||맞힌 사람||정답 비율|
|1 초||32 MB||1||0||0||0.000%|
Lots of numbers have many interesting properties. In this task we will take a look at one such property. First let's define the reverse of a number: The reverse of a number N with decimal notation an...a1a0 is the number a0a1...an (i.e., the number obtained by writing the digits of N in reverse order). We will denote the reverse of a number N as Rev(N). For example Rev(123) = 321 and Rev(7400) = 47.
You will be given several natural numbers. For each of them your task will be to decide whether it is equal to N +Rev(N) for some natural number N.
The input will consist of up to 10 001 lines. On each line there will be one positive number with less than 10 000 digits. The last line of the input file contains the number 0. This number should not be processed.
For each number M in the input file the output shall contain one line with the word "YES" (if for some N we have M = N + Rev(N)) or "NO" (otherwise).
1 2 11 13 14003 767513456469789456166547987979741366664879441 0
NO YES YES NO YES NO