PivotOJ

Chemist’s vows

시간 제한: 1000ms메모리 제한: 128MB출처: CERC 2012BOJ 3407

문제

Chemist Clara swore a solemn vow—from now on, she can only speak atomic element symbols. Of course, this limits her ability to talk. She can say, for example, “I Am CLaRa” (as I is the symbol of iodine, Am is americium, C is carbon and so on). She can also say “InTeRnAtIONAl”, but she has a lot of trouble with “collegiate”, “programming” and “contest”.

Given a word, determine whether Clara can speak it (i.e. if it is a concatenation of atomic symbols). Without your help, she might as well have taken silence vows!

You may identify upper- and lowercase letters, as Clara cannot speak uppercase anyway. In case you forgot the elements’ symbols, here is the complete periodic table:

입력

The first line of the input contains the number of test cases T. The descriptions of the test cases follow:

Each test case is a single lowercase word over the English alphabet. The length of the word is positive and does not exceed 50 000.

출력

Print the answers to the test cases in the order in which they appear in the input. For each test case print a single line containing the word YES if Clara can say the given word, and NO otherwise.

예제

예제 1

입력
4
international
collegiate
programming
contest
출력
YES
NO
NO
NO
코드를 제출하려면 로그인하세요.