Reverse Numbers

No attempts yetTime limit1sMemory limit32 MB

Problem

Numbers have many interesting properties. In this problem we look at one of them.

First, let us define the reverse of a number. For a number NN written in decimal as ana1a0a_n \dots a_1 a_0, its reverse is the number a0a1ana_0 a_1 \dots a_n obtained by writing the digits in the opposite order; we denote it Rev(N)\mathrm{Rev}(N). Any leading zeros produced this way are dropped. For example, Rev(123)=321\mathrm{Rev}(123) = 321 and Rev(7400)=47\mathrm{Rev}(7400) = 47.

You are given several natural numbers. For each number MM, decide whether there exists a natural number NN such that M=N+Rev(N)M = N + \mathrm{Rev}(N).

Input

The input consists of at most 10001 lines. Each line contains one positive integer with fewer than 10000 digits. The last line contains the number 00, which must not be processed.

Output

For each number MM in the input, print YES on its own line if there exists a natural number NN with M=N+Rev(N)M = N + \mathrm{Rev}(N), and NO otherwise.