Bored after completing all of the statistics handouts for the day, you turn around to take a peek at what Christian is doing. As it turns out, he is working on a list of
- Select two consecutive occurrences of the same letter and replace them with one occurrence of the next letter in the alphabet. Note that
z
is the last letter of the alphabet, sozz
cannot be replaced.
After working on the puzzles for a few minutes, you have a strange suspicion that some of them are impossible. Thus, write a program to determine if it is possible to solve each puzzle.
Constraints
The sum of
Subtask 1 [30%]
a
and b
.
Subtask 2 [70%]
No additional constraints.
Input Specification
The first line contains an integer
The next
Output Specification
For each puzzle, output YES
if it is solvable or NO
otherwise.
Sample Input
3
caabdfgg efh
zz z
dmopc funcontest
Sample Output
YES
NO
NO
Comments