Problem B - Counting 1s ----------------------- Zaphod, a rather strange friend of yours from a different planet, is interested in finding a number n that is equal to the number of 1s in the decimal digits of all numbers <= n. In other words, if you write all numbers from 1 to n, you will need to write the digit 1 n times. Input ----- Input consists of multiple lines, one line per case. Each line contains a single positive integer between 1 and 10^18 inclusive. There are no leading zeros for these numbers. Input is terminated by a line containing 0. Output ------ For each case, print one line containing the string YES if the input is a number that will satisfy Zaphod. Print NO otherwise. Sample Input ------------ 1 10 42 90210 199981 0 Output for sample input ----------------------- YES NO NO NO YES