Banner Home Page Web Contests Problems Ranklist Status Statistics

Digital Deletions

Time Limit : 4000/2000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 0   Accepted Submission(s) : 0
Problem Description
Digital deletions is a two-player game. The rule of the game is as following. <br><br>Begin by writing down a string of digits (numbers) that's as long or as short as you like. The digits can be 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and appear in any combinations that you like. You don't have to use them all. Here is an example:<br><br><center><img src=/data/images/1404-1.gif></center><br><br>On a turn a player may either:<br>Change any one of the digits to a value less than the number that it is. (No negative numbers are allowed.) For example, you could change a 5 into a 4, 3, 2, 1, or 0. <br>Erase a zero and all the digits to the right of it.<br><br><br>The player who removes the last digit wins.<br><br><br>The game that begins with the string of numbers above could proceed like this: <br><br><center><img src=/data/images/1404-2.gif></center><br><br>Now, given a initial string, try to determine can the first player win if the two players play optimally both. <br>
 

Input
The input consists of several test cases. For each case, there is a string in one line.<br><br>The length of string will be in the range of [1,6]. The string contains only digit characters.<br><br>Proceed to the end of file.<br>
 

Output
Output Yes in a line if the first player can win the game, otherwise output No.<br>
 

Sample Input
0<br>00<br>1<br>20<br>
 

Sample Output
Yes<br>Yes<br>No<br>No<br>
 

Author
ZHENG, Jianqiang
 

Source
Zhejiang University Local Contest 2006 Preliminary
 

Statistic | Submit | Back