logo AlgoBeat OnlineJudge
登录 注册

#215595. [CERC2012] Chemist' s vows

内存限制:256 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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:

H                                                                   He

Li  Be                                          B   C   N   O   F   Ne

Na  Mg                                          Al  Si  P   S   Cl  Ar

K   Ca  Sc  Ti  V   Cr  Mn  Fe  Co  Ni  Cu  Zn  Ga  Ge  As  Se  Br  Kr

Rb  Sr  Y   Zr  Nb  Mo  Tc  Ru  Rh  Pd  Ag  Cd  In  Sn  Sb  Te  I   Xe

Cs  Ba  *   Hf  Ta  W   Re  Os  Ir  Pt  Au  Hg  Tl  Pb  Bi  Po  At  Rn

Fr  Ra  **  Rf  Db  Sg  Bh  Hs  Mt  Ds  Rg  Cn      Fl      Lv


*  La  Ce  Pr  Nd  Pm  Sm  Eu  Gd  Tb  Dy  Ho  Er  Tm  Yb  Lu
** Ac  Th  Pa  U   Np  Pu  Am  Cm  Bk  Cf  Es  Fm  Md  No  Lr

输入格式

The first line of the input contains the number of test cases . 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 .

输出格式

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

样例输出 1

YES
NO
NO
NO