Problem1207--Name

1207: Name

[Creator : ]
Time Limit : 1 sec  Memory Limit : 128 MB

Description

 There was a boy called ZDD, and he loved a girl whose name is SZD. They loved each other deeply. After saving SZD from TIANKENG, they led a happy life. And later they had a son, and choosing name of their son was a big problem. ZDD was very like “ABB” style. For example, “ZhaoDongDong” is a “ABB” style name, and “ChenLiJian” is not. Then ZDD wanted to know if a name was “ABB” style or not?

Input

The first line is an integer T, which indicates the number of test case.

For each test case, there is a string S, which indicates the name of their son. The length of the string is not more than 100. The first letter of every word will be capital. And it may be many space between them, you should ignore them. Besides, the name string only contains uppercase and lowercase letters.

Output

 For each test case, if the name is “ABB” style output “Yes”, otherwise output “No” in one line.

Sample Input Copy

2
ZhaoDongDong
ChenLiJian

Sample Output Copy

Yes
No

Source/Category

 字符串