시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 419 108 82 28.671%

문제

위대한 화학자 김선영은 그를 바라보며 굳은 맹세를 했다.

난 오늘부터 원소 기호로 이루어진 단어만을 말할 것이다.

선영이는 "I Am CLaRa"를 말할 수 있다. I 는 아이오딘, Am은 아메리슘, C는 탄소, La는 라타넘, Ra는 라듐이다. 또, 선영이는 "InTeRnAtIONAl"도 말할 수 있다. 하지만, "collegiate", "programming", "contest"는 원소 기호로 이루어진 단어가 아니기 때문에 말할 수 없다.

단어가 주어졌을 때, 선영이가 말할 수 있는 단어 인지 (원소 기호가 연결된 단어) 아닌지를 구하는 프로그램을 작성하시오. (대소문자는 가리지 않는다)

다음은 이 문제에서 사용하는 원소 주기율표이다.

HHe
LiBeBCNOFNe
NaMgAlSiPSClAr
KCaScTiVCrMnFeCoNiCuZnGaGeAsSeBrKr
RbSrYZrNbMoTcRuRhPdAgCdInSnSbTeIXe
CsBa*HfTaWReOsIrPtAuHgTlPbBiPoAtRn
FrRa**RfDbSgBhHsMtDsRgCnFlLv
* 란타넘족 LaCePrNdPmSmEuGdTbDyHoErTmYbLu
** 악티늄족 AcThPaUNpPuAmCmBkCfEsFmMdNoLr

입력

첫째 줄에 테스트 케이스의 개수 T가 주어진다. 다음 T개의 줄에는 알파벳 소문자로만 된 단어가 하나 주어진다. 단어의 길이는 50,000을 넘지 않으며 양수이다.

출력

입력으로 주어진 단어가 선영이가 발음할 수 있는 단어라면 YES를, 아니라면 NO를 출력한다.

예제 입력 1

4
international
collegiate
programming
contest

예제 출력 1

YES
NO
NO
NO
W3sicHJvYmxlbV9pZCI6IjM0MDciLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWI5ZjlcdWMxMzgiLCJkZXNjcmlwdGlvbiI6IjxwPlx1YzcwNFx1YjMwMFx1ZDU1YyBcdWQ2NTRcdWQ1NTlcdWM3OTAgXHVhZTQwXHVjMTIwXHVjNjAxXHVjNzQwIFx1YWRmOFx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