-----Input-----

The input consists of a single string of uppercase letters A-Z. The length of the string is between 1 and 10 characters, inclusive.


-----Output-----

Output "YES" or "NO".


-----Examples-----
Input
GENIUS

Output
YES

Input
DOCTOR

Output
NO

Input
IRENE

Output
YES

Input
MARY

Output
NO

Input
SMARTPHONE

Output
NO

Input
REVOLVER

Output
YES

Input
HOLMES

Output
NO

Input
WATSON

Output
YES

Source: codeforces | Difficulty: MEDIUM


Solutions:
def r(c):
	return ord(c) - ord('A')

def kek():
	x = input()
	if len(x) <= 2:
		print('YES')
		return
	(a, b) = (r(x[0]), r(x[1]))
	for i in range(2, len(x)):
		c = r(x[i])
		if (a + b) % 26 != c:
			print('NO')
			return
		(a, b) = (b, c)
	print('YES')
kek()


import sys
input = sys.stdin.readline
S = list(input())[:-1]
S = [ord(x) - ord('A') for x in S]
for i in range(len(S) - 2):
	if (S[i] + S[i + 1]) % 26 != S[i + 2]:
		break
else:
	print('YES')
	exit(0)
print('NO')


s = input()
alph = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
da = dict(zip(alph, range(26)))
isok = True
for i in range(2, len(s)):
	if da[s[i]] != (da[s[i - 1]] + da[s[i - 2]]) % 26:
		isok = False
if isok:
	print('YES')
else:
	print('NO')


a = ['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', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og', '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']

def f(x):
	n = len(a)
	for i in range(n):
		if a[i] == x:
			return 1
	return 0

def dfs(cur, s, n):
	if cur >= n:
		return 1
	flg = 0
	if cur < n - 1:
		if f(str() + s[cur] + s[cur + 1]) == 1:
			flg |= dfs(cur + 2, s, n)
	if f(s[cur]) == 1:
		flg |= dfs(cur + 1, s, n)
	return flg
n = len(a)
for i in range(n):
	a[i] = a[i].upper()
s = list(input())
n = len(s)
i = 0
flg = dfs(0, s, n)
if flg == 0:
	print('NO')
else:
	print('YES')


def check():
	inp = list(map(lambda x: ord(x) - 65, input()))
	for idx in range(2, len(inp)):
		if inp[idx] != sum(inp[idx - 2:idx]) % 26:
			return 'NO'
	return 'YES'
print(check())


l = 'H\nHe\nLi\nBe\nB\nC\nN\nO\nF\nNe\nNa\nMg\nAl\nSi\nP\nS\nCl\nAr\nK\nCa\nSc\nTi\nV\nCr\nMn\nFe\nCo\nNi\nCu\nZn\nGa\nGe\nAs\nSe\nBr\nKr\nRb\nSr\nY\nZr\nNb\nMo\nTc\nRu\nRh\nPd\nAg\nCd\nIn\nSn\nSb\nTe\nI\nXe\nCs\nBa\nLa\nCe\nPr\nNd\nPm\nSm\nEu\nGd\nTb\nDy\nHo\nEr\nTm\nYb\nLu\nHf\nTa\nW\nRe\nOs\nIr\nPt\nAu\nHg\nTl\nPb\nBi\nPo\nAt\nRn\nFr\nRa\nAc\nTh\nPa\nU\nNp\nPu\nAm\nCm\nBk\nCf\nEs\nFm\nMd\nNo\nLr\nRf\nDb\nSg\nBh\nHs\nMt\nDs\nRg\nCn\nNh\nFl\nMc\nLv\nTs\nOg'.split()
l = list([x.lower() for x in l])
inp = input().strip().lower()
dp = [True]
for i in range(len(inp)):
	works = False
	if dp[-1] and inp[i] in l:
		works = True
	if i and dp[-2] and (inp[i - 1:i + 1] in l):
		works = True
	dp.append(works)
if dp[-1]:
	print('YES')
else:
	print('NO')


s = input()
c = ['B', 'C', 'D', 'G', 'J', 'O', 'P', 'Q', 'R', 'S', 'U']
flag = 0
for i in range(len(s)):
	if s[i] in c:
		flag = 1
		break
if flag == 0:
	print('YES')
	exit()
flag = 0
for i in range(len(s)):
	if s[i] not in c:
		flag = 1
		break
if flag == 0:
	print('YES')
	exit()
print('NO')


import sys
input = sys.stdin.readline

def solve():
	s = input().strip()
	z = 0
	for i in range(2, len(s)):
		if (ord(s[i]) - ord('A') - (ord(s[i - 1]) - ord('A')) - (ord(s[i - 2]) - ord('A'))) % 26 != 0:
			print('NO')
			return
	print('YES')
solve()


z = 'QWERTYUIOPASDFGHJKLZXCVBNM'
t = '01101101001001010111101011'
s = input()
cur = '-'
for i in s:
	for j in range(26):
		if z[j] == i:
			if cur == '-':
				cur = t[j]
			elif t[j] != cur:
				print('NO')
				exit(0)
print('YES')


def check_fib(s):
	if len(s) <= 2:
		return 'YES'
	s = list(map(lambda x: ord(x) - ord('A'), s))
	for i in range(2, len(s)):
		if s[i] != (s[i - 1] + s[i - 2]) % 26:
			return 'NO'
	return 'YES'
print(check_fib(input()))


import sys
import math
import heapq
import bisect
from collections import Counter
from collections import defaultdict
from io import BytesIO, IOBase
import string

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None
		self.BUFSIZE = 8192

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def get_int():
	return int(input())

def get_ints():
	return list(map(int, input().split(' ')))

def get_int_grid(n):
	return [get_ints() for _ in range(n)]

def get_str():
	return input().strip()

def get_strs():
	return get_str().split(' ')

def flat_list(arr):
	return [item for subarr in arr for item in subarr]

def yes_no(b):
	if b:
		return 'YES'
	else:
		return 'NO'

def binary_search(good, left, right, delta=1, right_true=False):
	limits = [left, right]
	while limits[1] - limits[0] > delta:
		if delta == 1:
			mid = sum(limits) // 2
		else:
			mid = sum(limits) / 2
		if good(mid):
			limits[int(right_true)] = mid
		else:
			limits[int(~right_true)] = mid
	if good(limits[int(right_true)]):
		return limits[int(right_true)]
	else:
		return False

def prefix_sums(a):
	p = [0]
	for x in a:
		p.append(p[-1] + x)
	return p

def solve_a():
	while True:
		try:
			x = input().strip()
			if x == 'Is it rated?':
				print('NO')
				sys.stdout.flush()
		except:
			break

def solve_b():
	n = get_int()
	while len(str(n)) > 1:
		n = sum([int(char) for char in str(n)])
	return n

def solve_c():
	alpha = {char: i for (i, char) in enumerate(string.ascii_lowercase)}
	s = get_str().lower()
	n = len(s)
	for i in range(2, n):
		if (alpha[s[i - 1]] + alpha[s[i - 2]] - alpha[s[i]]) % 26 != 0:
			return 'NO'
	return 'YES'
print(solve_c())


ll = ['A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'W', 'X', 'Y', 'Z']
s = input()
f1 = 0
f2 = 0
for i in range(len(s)):
	f1 = 0
	for j in range(15):
		if s[i] == ll[j]:
			f1 = 1
			if not i:
				f2 = 1
			elif not f2:
				print('NO')
				exit()
	if not f1:
		if not i:
			f2 = 0
		elif f2:
			print('NO')
			exit()
print('YES')


s = input()
a = {'A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'W', 'X', 'Y', 'Z'}
b = {'B', 'C', 'D', 'G', 'J', 'O', 'P', 'Q', 'R', 'S', 'U'}
print('YES' if all((c in a for c in s)) or all((c in b for c in s)) else 'NO')


fuck = ['h', 'he', 'li', 'be', 'b', 'lv', 'nh', 'fl', 'mc', 'ts', 'og', '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', 'la', 'ce', 'pr', 'nd', 'pm', 'sm', 'eu', 'gd', 'tb', 'dy', 'ho', 'er', 'tm', 'yb', 'lu', 'hf', 'ta', 'w', 're', 'os', 'ir', 'pt', 'au', 'hg', 'tl', 'pb', 'bi', 'po', 'at', 'rn', 'fr', 'ra', 'ac', 'rf', 'th', 'pa', 'u', 'np', 'pu', 'am', 'cm', 'bk', 'cf', 'es', 'fm', 'md', 'no', 'lr', 'db', 'sg', 'bh', 'hs', 'mt', 'ds', 'rg', 'cn']

def dfs(pos):
	nonlocal s, a
	if pos == len(s):
		a = 1
		return
	for i in fuck:
		if pos + len(i) <= len(s) and i == s[pos:pos + len(i)]:
			dfs(pos + len(i))
	return
s = input().strip().lower()
a = 0
dfs(0)
if a == 0:
	print('NO')
else:
	print('YES')


s = input()
good = True
while good and len(s) > 2:
	c = chr((ord(s[0]) + ord(s[1]) - ord('A') * 2) % 26 + ord('A'))
	good = c == s[2]
	s = s[1:]
print('YES' if good else 'NO')


def main():
	t = list(input())
	s = []
	for i in t:
		s.append(ord(i) - 64)
	for i in range(2, len(s)):
		if s[i] != s[i - 1] + s[i - 2] - 1 and s[i] + 26 != s[i - 1] + s[i - 2] - 1:
			return 'NO'
	return 'YES'
print(main())


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 La Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn Fr Ra Ac Th Pa U Np Pu Am Cm Bk Cf Es Fm Md No Lr Rf Db Sg Bh Hs Mt Ds Rg Cn Nh Fl Mc Lv Ts Og Uue Ubn Ubu Ubb Ubt Ubq Ubp Ubh Ubs'
elements = [x.upper() for x in table.split()]

def elementary(word):
	if word == '':
		return True
	if word[0:1] in elements and elementary(word[1:]):
		return True
	if word[0:2] in elements and elementary(word[2:]):
		return True
	if word[0:3] in elements and elementary(word[3:]):
		return True
	return False
word = input()
if elementary(word):
	print('YES')
else:
	print('NO')


s = input()
if len(s) <= 2:
	print('YES')
else:
	flag = True
	for i in range(2, len(s)):
		t = ord(s[i - 1]) - ord('A') + 1 + ord(s[i - 2]) - ord('A')
		while t > 26:
			t -= 26
		if t != ord(s[i]) - ord('A') + 1:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


n = input()
s = 'AEFHIKLMNTVWXYZ'
t = 'BCDGJOPQRSU'
f1 = 0
f2 = 0
for i in s:
	if i in n:
		f1 = 1
for i in t:
	if i in n:
		f2 = 1
if f1 + f2 == 1:
	print('YES')
else:
	print('NO')


s = input()
if len(s) <= 2:
	print('YES')
else:
	n = len(s)
	a = [0] * n
	ok = True
	for i in range(n):
		a[i] = ord(s[i]) - ord('A')
	for i in range(2, n):
		if a[i] != (a[i - 1] + a[i - 2]) % 26:
			ok = False
			break
	if ok:
		print('YES')
	else:
		print('NO')


def li():
	return list(map(int, input().split(' ')))
a = 'AEFHIKLMNTVWXYZ'
b = 'BCDGJOQRSPU'
aa = bb = False
for i in input():
	if i in a:
		aa = True
	else:
		bb = True
if aa ^ bb:
	print('Yes')
else:
	print('No')


t1 = ['A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'W', 'X', 'Y', 'Z']
flag1 = False
flag2 = False
arr = list(input())
for i in arr:
	if i in t1:
		flag1 = True
	else:
		flag2 = True
if flag2 and flag1:
	print('NO')
else:
	print('YES')


import os
import sys
if os.environ['USERNAME'] == 'kissz':
	w = 'HELP'
else:
	w = input()
G = [ord(c) - ord('A') for c in w]
print(G, file=sys.stderr)
ok = True
for i in range(2, len(G)):
	if G[i] != (G[i - 2] + G[i - 1]) % 26:
		ok = False
if ok:
	print('YES')
else:
	print('NO')


s = input()
print('NYOE S'[all(((ord(s[i]) + ord(s[i + 1]) - ord(s[i + 2])) % 26 == 13 for i in range(len(s) - 2)))::2])


a = 'abcdefghijklmnopqrstuvwxyz'
s = input().lower()
ans = 'YES'
for i in range(2, len(s)):
	if a.index(s[i]) != (a.index(s[i - 2]) + a.index(s[i - 1])) % 26:
		ans = 'NO'
print(ans)


import sys
elements = ['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', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'At', 'Rn', 'Fr', 'Ra', 'Ac', 'Th', 'Pa', 'U', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md', 'No', 'Lr', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og']
lower = [x.lower() for x in elements]
word = input().lower()
s = ''
t = None
si = -1
ti = None
if word[0] in lower:
	t = elements[lower.index(word[0])] + ' '
	ti = 0
while True:
	if si == None and ti == None:
		print('NO')
		sys.exit(0)
	if si != None and si == len(word) - 1:
		print('YES')
		sys.exit(0)
	if ti != None and ti == len(word) - 1:
		print('YES')
		sys.exit(0)
	newT = None
	newTi = None
	newS = t
	newSi = ti
	if ti != None:
		if word[ti + 1] in lower:
			newTi = ti + 1
			newT = t + elements[lower.index(word[ti + 1])] + ' '
	if newT == None:
		if si != None:
			if word[si + 1:si + 3] in lower:
				newTi = si + 2
				newT = s + elements[lower.index(word[si + 1:si + 3])] + ' '
	if newS == None and si != None:
		if word[si + 1] in lower:
			newSi = si + 1
			newS = s + elements[lower.index(word[si + 1])] + ' '
	s = newS
	si = newSi
	t = newT
	ti = newTi


s = input()
T = 'AEFHIKLMNTVWXYZ'
ok1 = 1
ok2 = 1
for i in s:
	if i not in T:
		ok1 = 0
	else:
		ok2 = 0
print(['NO', 'YES'][ok1 or ok2])


elems = set(['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', 'NH', 'FL', 'MC', 'LV', 'TS', 'OG', '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'])
s = input()
n = len(s)
dp = [False for _ in range(n + 1)]
dp[0] = True
for i in range(n):
	if not dp[i]:
		continue
	if s[i] in elems:
		dp[i + 1] = True
	if i + 2 <= n and s[i:i + 2] in elems:
		dp[i + 2] = True
print('YES' if dp[n] else 'NO')


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
import time
start_time = time.time()
import collections as col
import math, string
from functools import reduce

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7

def solve():
	els = ['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', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'At', 'Rn', 'Fr', 'Ra', 'Ac', 'Th', 'Pa', 'U', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md', 'No', 'Lr', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og']
	for (i, el) in enumerate(els):
		els[i] = el.upper()
	dp = [True]
	S = getStr()
	for i in range(len(S)):
		if len(dp) == 1:
			dp.append(dp[-1] and S[i].upper() in els)
		else:
			dp.append(dp[-1] and S[i].upper() in els or (dp[-2] and S[i - 1:i + 1].upper() in els))
	return 'YES' if dp[len(S)] else 'NO'
print(solve())


s = input()
l = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
l2 = []
for i in s:
	l2.append(l.index(i))
c = 0
for i in range(len(l2) - 2):
	if l2[i] + l2[i + 1] == l2[i + 2] or l2[i] + l2[i + 1] - 26 == l2[i + 2]:
		c += 1
if c == len(l2) - 2 or len(l2) <= 2:
	print('YES')
else:
	print('NO')


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def msi():
	return map(str, input().split())

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def lsi():
	return list(msi())

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def lcm(x, y):
	return x * y // gcd(x, y)
mod = 1000000007

def modInverse(b, m):
	g = gcd(b, m)
	if g != 1:
		return -1
	else:
		return pow(b, m - 2, m)

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def modu(a, b, m):
	a = a % m
	inv = modInverse(b, m)
	if inv == -1:
		return -999999999
	else:
		return inv * a % m
from math import log, factorial, cos, tan, sin, radians, floor, sqrt
import bisect
import random
import string
from decimal import *
getcontext().prec = 50
abc = 'abcdefghijklmnopqrstuvwxyz'
pi = 3.141592653589793

def gcd1(a):
	if len(a) == 1:
		return a[0]
	ans = a[0]
	for i in range(1, len(a)):
		ans = gcd(ans, a[i])
	return ans

def mykey(x):
	return (x[1], -x[0])

def main():
	s = si()
	if len(s) <= 2:
		print('YES')
	else:
		x = ord(s[0]) - 65
		y = ord(s[1]) - 65
		f = 1
		for i in range(2, len(s)):
			z = ord(s[i]) - 65
			z %= 26
			if z != (x + y) % 26:
				f = 0
				break
			x = y
			y = z
		if f:
			print('YES')
		else:
			print('NO')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


strs = 'Ac\nAg\nAl\nAm\nAr\nAs\nAt\nAu\nB\nBa\nBe\nBh\nBi\nBk\nBr\nC\nCa\nCd\nCe\nCf\nCl\nCm\nCn\nCo\nCr\nCs\nCu\nDb\nDs\nDy\nEr\nEs\nEu\nF\nFe\nFl\nFm\nFr\nGa\nGd\nGe\nH\nHe\nHf\nHg\nHo\nHs\nI\nIn\nIr\nK\nKr\nLa\nLi\nLr\nLu\nLv\nMc\nMd\nMg\nMn\nMo\nMt\nN\nNa\nNb\nNd\nNe\nNh\nNi\nNo\nNp\nO\nOg\nOs\nP\nPa\nPb\nPd\nPm\nPo\nPr\nPt\nPu\nRa\nRb\nRe\nRf\nRg\nRh\nRn\nRu\nS\nSb\nSc\nSe\nSg\nSi\nSm\nSn\nSr\nTa\nTb\nTc\nTe\nTh\nTi\nTl\nTm\nTs\nU\nUbb\nUbh\nUbn\nUbp\nUbq\nUbt\nUbu\nUue\nV\nW\nXe\nY\nYb\nZn\nZr'
ele = strs.upper().split('\n')
inp = input()
n = len(inp)
dp = [False] * (n + 1)
dp[0] = True
for i in range(1, n + 1):
	if dp[i - 1] == True and inp[i - 1:i] in ele:
		dp[i] = True
	elif i > 1 and dp[i - 2] == True and (inp[i - 2:i] in ele):
		dp[i] = True
	elif i > 2 and dp[i - 3] == True and (inp[i - 3:i] in ele):
		dp[i] = True
if dp[n]:
	print('YES')
else:
	print('NO')


a = 'AEFHIKLMNTVWXYZ'
b = 'BCDGJOPQRSU'
s = input()
ina = True
inb = True
for x in s:
	if x not in a:
		ina = False
	if x not in b:
		inb = False
if ina or inb:
	print('YES')
else:
	print('NO')


list = 'AEFHIKLMNTVWXYZ'
word = input()
(x, y) = (0, 0)
for w in word:
	if w in list:
		x += 1
	else:
		y += 1
if x == 0 or y == 0:
	print('YES')
else:
	print('NO')


s = input()
n = len(s)
flag = 0
if n < 3:
	print('YES')
	flag = 1
for i in range(2, n):
	if ord(s[i]) - 65 != (ord(s[i - 1]) + ord(s[i - 2]) - 130) % 26:
		print('NO')
		flag = 1
		break
if flag == 0:
	print('YES')


s = input()
a = [(ord(i) & 31) - 1 for i in s]
for i in range(2, len(a)):
	if a[i] != (a[i - 1] + a[i - 2]) % 26:
		print('NO')
		exit()
print('YES')


clean = 'AEFHIKLMNTVWXYZ'
string = input()
sum_ = 0
for i in string:
	if i in clean:
		sum_ += 1
if sum_ == len(string) or sum_ == 0:
	print('YES')
else:
	print('NO')


elements = ['Ac', 'Ag', 'Al', 'Am', 'Ar', 'As', 'At', 'Au', 'B', 'Ba', 'Be', 'Bh', 'Bi', 'Bk', 'Br', 'C', 'Ca', 'Cd', 'Ce', 'Cf', 'Cl', 'Cm', 'Cn', 'Co', 'Cr', 'Cs', 'Cu', 'Db', 'Ds', 'Dy', 'Er', 'Es', 'Eu', 'F', 'Fe', 'Fl', 'Fm', 'Fr', 'Ga', 'Gd', 'Ge', 'H', 'He', 'Hf', 'Hg', 'Ho', 'Hs', 'I', 'In', 'Ir', 'K', 'Kr', 'La', 'Li', 'Lr', 'Lu', 'Lv', 'Mc', 'Md', 'Mg', 'Mn', 'Mo', 'Mt', 'N', 'Na', 'Nb', 'Nd', 'Ne', 'Nh', 'Ni', 'No', 'Np', 'O', 'Og', 'Os', 'P', 'Pa', 'Pb', 'Pd', 'Pm', 'Po', 'Pr', 'Pt', 'Pu', 'Ra', 'Rb', 'Re', 'Rf', 'Rg', 'Rh', 'Rn', 'Ru', 'S', 'Sb', 'Sc', 'Se', 'Sg', 'Si', 'Sm', 'Sn', 'Sr', 'Ta', 'Tb', 'Tc', 'Te', 'Th', 'Ti', 'Tl', 'Tm', 'Ts', 'U', 'V', 'W', 'Xe', 'Y', 'Yb', 'Zn', 'Zr']
elements = [*list(map(str.upper, elements))]
target = input()

def helper(target):
	dp = [0]
	met = set([0])
	while dp:
		idx = dp.pop()
		for e in elements:
			if target.startswith(e, idx) and len(e) + idx not in met:
				if len(e) + idx == len(target):
					print('YES')
					return
				dp += (idx + len(e),)
				met.add(idx + len(e))
	print('NO')
helper(target)


def main():
	a = set('AEFHIKLMNTVWXYZ')
	b = set('BCDGJOPQRSU')
	w = list(input())
	in_a = False
	in_b = False
	for l in w:
		in_a = in_a or l in a
		in_b = in_b or l in b
	if in_a and in_b:
		print('NO')
	else:
		print('YES')
main()


def cid(x):
	return ord(x) - ord('A')

def let(x):
	return chr(x + ord('A'))
S = input()
if len(S) <= 2:
	print('YES')
else:
	a = cid(S[0])
	b = cid(S[1])
	idx = 2
	while idx < len(S) and let((a + b) % 26) == S[idx]:
		a = cid(S[idx - 1])
		b = cid(S[idx])
		idx += 1
	if idx == len(S):
		print('YES')
	else:
		print('NO')


E = 'H\t \tHe\n\tLi\tBe\t \tB\tC\tN\tO\tF\tNe\n    Na\tMg\t \tAl\tSi\tP\tS\tCl\tAr\n\tK\tCa\t \tSc\tTi\tV\tCr\tMn\tFe\tCo\tNi\tCu\tZn\tGa\tGe\tAs\tSe\tBr\tKr\n\tRb\tSr\t \tY\tZr\tNb\tMo\tTc\tRu\tRh\tPd\tAg\tCd\tIn\tSn\tSb\tTe\tI\tXe\n    Cs\tBa\tLa\tCe\tPr\tNd\tPm\tSm\tEu\tGd\tTb\tDy\tHo\tEr\tTm\tYb\tLu\tHf\tTa\tW\tRe\tOs\tIr\tPt\tAu\tHg\tTl\tPb\tBi\tPo\tAt\tRn\n\tFr\tRa\tAc\tTh\tPa\tU\tNp\tPu\tAm\tCm\tBk\tCf\tEs\tFm\tMd\tNo\tLr\tRf\tDb\tSg\tBh\tHs\tMt\tDs\tRg\tCn\tNh\tFl\tMc\tLv\tTs\tOg\n'.upper().split()
S = input()
N = len(S)
DP = [0] * (N + 1)
DP[0] = 1
for i in range(N):
	for j in range(1, 3):
		if i + j > N:
			break
		if S[i:i + j] in E:
			DP[i + j] |= DP[i]
if DP[N]:
	print('YES')
else:
	print('NO')


a = input()
print(('NO', 'YES')[sum((x in 'AEFHIKLMNTVWXYZ' for x in a)) in (0, len(a))])


x = []
mylist = list(input())
for i in mylist:
	if i in 'BCDGJOPQRSU':
		x.append(True)
	else:
		x.append(False)
if all((x[0] == elem for elem in x)):
	print('YES')
else:
	print('NO')


def main():
	s = input()
	if len(s) < 2:
		print('YES')
		exit()
	a = ord(s[0]) - 65
	b = ord(s[1]) - 65
	for i in range(2, len(s)):
		c = ord(s[i]) - 65
		if (a + b) % 26 != c:
			print('NO')
			exit()
		a = b
		b = c
	print('YES')
main()


def mp():
	return map(int, input().split())

def g(s):
	return [ord(i) - ord('A') for i in s]
fail = False
s = input()
a = g(s)
for i in range(2, len(a)):
	if (a[i - 2] + a[i - 1]) % 26 != a[i]:
		fail = True
print('NO' if fail else 'YES')


zw = [True, False, False, False, True, True, False, True, True, False, True, True, True, True, False, False, False, False, False, True, False, True, True, True, True, True]
h = True
s = input()
b = zw[ord(s[0]) - 65]
for i in s:
	if b != zw[ord(i) - 65]:
		h = False
		break
if h:
	print('YES')
else:
	print('NO')


x = ['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', 'LA', 'CE', 'PR', 'ND', 'PM', 'SM', 'EU', 'GD', 'TB', 'DY', 'HO', 'ER', 'TM', 'YB', 'LU', 'HF', 'TA', 'W', 'RE', 'OS', 'IR', 'PT', 'AU', 'HG', 'TL', 'PB', 'BI', 'PO', 'AT', 'RN', 'FR', 'RA', 'AC', 'TH', 'PA', 'U', 'NP', 'PU', 'AM', 'CM', 'BK', 'CF', 'ES', 'FM', 'MD', 'NO', 'LR', 'RF', 'DB', 'SG', 'BH', 'HS', 'MT', 'DS', 'RG', 'CN', 'NH', 'FL', 'MC', 'LV', 'TS', 'OG']

def do(s):
	if len(s) == 0:
		print('YES')
		return
	if len(s) > 1:
		try:
			x.index(s[:2])
			do(s[2:])
		except ValueError:
			pass
	try:
		x.index(s[0])
		do(s[1:])
	except ValueError:
		pass
s = input()
do(s)
print('NO')


def getIndex(lett):
	return ord(lett) - 65
word = input()
if len(word) < 3:
	print('YES')
	exit()
a = getIndex(word[0])
b = getIndex(word[1])
for c in word[2:]:
	p = getIndex(c)
	if p != (a + b) % 26:
		print('NO')
		exit()
	a = b
	b = p
print('YES')


s = input()
for i in range(2, len(s)):
	if (ord(s[i - 1]) - ord('A') + ord(s[i - 2]) - ord('A')) % 26 != ord(s[i]) - ord('A'):
		print('NO')
		exit()
print('YES')


straight = ['A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'X', 'W', 'Y', 'Z']
s = list(input())
s = set(map(lambda x: x in straight, s))
print('YES' if len(s) == 1 else 'NO')


s = list(input())
if len(s) < 3:
	print('YES')
else:
	s = list(map(lambda x: ord(x) - ord('A'), s))
	can = True
	for i in range(2, len(s)):
		if s[i] == (s[i - 2] + s[i - 1]) % 26:
			continue
		can = False
	print('YES' if can else 'NO')


s = str(input())
prev = 0
prevv = 0
for (i, c) in enumerate(list(s.strip())):
	cur = ord(c) - ord('A')
	if i >= 2 and cur != int(prev + prevv) % 26:
		print('NO')
		exit(0)
	prevv = prev
	prev = cur
print('YES')


import math
s = input()
p = []
flag = 0
for i in range(26):
	p.append(chr(i + 65))
for i in range(2, len(s)):
	if (p.index(s[i - 1]) + p.index(s[i - 2])) % 26 != p.index(s[i]):
		print('NO')
		flag = 1
		break
if flag == 0:
	print('YES')


import sys
s = input()

def f(c):
	return ord(c) - ord('A')
for i in range(2, len(s)):
	if f(s[i]) != (f(s[i - 1]) + f(s[i - 2])) % 26:
		print('NO')
		sys.exit(0)
print('YES')


from string import ascii_uppercase as u
s = input()
for i in range(2, len(s)):
	if (u.index(s[i - 1]) + u.index(s[i - 2])) % 26 != u.index(s[i]):
		print('NO')
		exit()
print('YES')


s = input()
a = []
for i in s:
	a.append(ord(i) - 65)
flag = 0
for i in range(2, len(a)):
	if a[i] != (a[i - 1] + a[i - 2]) % 26:
		flag = 1
		break
if flag:
	print('NO')
else:
	print('YES')


import sys
input = iter(sys.stdin.read().splitlines()).__next__

def check(S):

	def F(c):
		return ord(c) - ord('A')
	if len(S) <= 2:
		return True
	a = F(S[0])
	b = F(S[1])
	for i in range(2, len(S)):
		c = F(S[i])
		if (a + b) % 26 != c:
			return False
		(a, b) = (b, c)
	return True
S = input()
print('YES' if check(S) else 'NO')


s = input()
num = []
if len(s) < 3:
	print('YES')
else:
	for c in s:
		num.append(ord(c) - 65)
	flag = True
	for i in range(len(s) - 2):
		if (num[i] + num[i + 1]) % 26 != num[i + 2]:
			flag = False
			break
	if flag:
		print('YES')
	else:
		print('NO')


import string
li = dict(zip(string.ascii_uppercase, range(0, 26)))
s = input()
if len(s) <= 2:
	print('YES')
else:
	a = li[s[0]]
	b = li[s[1]]
	flag = True
	for i in range(2, len(s)):
		if li[s[i]] != (a + b) % 26:
			flag = False
			break
		else:
			(a, b) = (b, li[s[i]])
	if flag:
		print('YES')
	else:
		print('NO')


s = input()
t = [ord(c) - 65 for c in s]
for i in range(2, len(t)):
	if t[i] != (t[i - 1] + t[i - 2]) % 26:
		print('NO')
		break
else:
	print('YES')


s = input()
n = len(s)
ans = 'YES'
for i in range(n - 2):
	if (ord(s[i]) + ord(s[i + 1]) - 129) % 26 + 1 != ord(s[i + 2]) - 63:
		ans = 'NO'
		break
print(ans)


elements = ['AC', 'AG', 'AL', 'AM', 'AR', 'AS', 'AT', 'AU', 'B', 'BA', 'BE', 'BH', 'BI', 'BK', 'BR', 'C', 'CA', 'CD', 'CE', 'CF', 'CL', 'CM', 'CN', 'CO', 'CR', 'CS', 'CU', 'DB', 'DS', 'DY', 'ER', 'ES', 'EU', 'F', 'FE', 'FL', 'FM', 'FR', 'GA', 'GD', 'GE', 'H', 'HE', 'HF', 'HG', 'HO', 'HS', 'I', 'IN', 'IR', 'K', 'KR', 'LA', 'LI', 'LR', 'LU', 'LV', 'MC', 'MD', 'MG', 'MN', 'MO', 'MT', 'N', 'NA', 'NB', 'ND', 'NE', 'NH', 'NI', 'NO', 'NP', 'O', 'OG', 'OS', 'P', 'PA', 'PB', 'PD', 'PM', 'PO', 'PR', 'PT', 'PU', 'RA', 'RB', 'RE', 'RF', 'RG', 'RH', 'RN', 'RU', 'S', 'SB', 'SC', 'SE', 'SG', 'SI', 'SM', 'SN', 'SR', 'TA', 'TB', 'TC', 'TE', 'TH', 'TI', 'TL', 'TM', 'TS', 'U', 'V', 'W', 'XE', 'Y', 'YB', 'ZN', 'ZR']

def in_table(word):
	result = False
	for element in elements:
		if element == word:
			return True
		elif len(word) > len(element) and word[:len(element)] == element:
			result = result or in_table(word[len(element):])
	return result

def main():
	word = input()
	if in_table(word):
		print('YES')
	else:
		print('NO')
main()


ss = input()
n = len(ss)
s = 0
for i in range(2, n):
	l = (ord(ss[i - 1]) - 64 + ord(ss[i - 2]) - 64 - 1) % 26
	if ord(ss[i]) - 64 != l:
		s = 1
		break
if s:
	print('NO')
else:
	print('YES')


abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
st = input()
fib = True
for i in range(2, len(st)):
	if abc.find(st[i]) != (abc.find(st[i - 1]) + abc.find(st[i - 2])) % 26:
		fib = False
if fib:
	print('YES')
else:
	print('NO')


import time
import os, sys
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import bisect_left, bisect_right
from collections import defaultdict as dd, deque as dq, Counter as dc
import math, string, heapq as h
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def getInt():
	return int(input())

def getStrs():
	return input().split()

def getInts():
	return list(map(int, input().split()))

def getStr():
	return input()

def listStr():
	return list(input())

def getMat(n):
	return [getInts() for _ in range(n)]

def getBin():
	return list(map(int, list(input())))

def isInt(s):
	return '0' <= s[0] <= '9'

def ceil_(a, b):
	return a // b + (a % b > 0)
MOD = 10 ** 9 + 7
neat = set('AEFHIKLMNTVWXYZ')
other = set('BCDGJOPQRSU')

def solve():
	assert len(neat) + len(other) == 26
	S = getStr()
	(x, y) = (0, 0)
	for letter in S:
		if letter in neat:
			x += 1
		else:
			y += 1
	return 'YES' if min(x, y) == 0 else 'NO'
print(solve())


S = input()
X = [ord(s) - 65 for s in S]
for i in range(2, len(X)):
	if (X[i - 1] + X[i - 2]) % 26 == X[i]:
		True
	else:
		print('NO')
		exit()
print('YES')


s = input()
if len(s) <= 2:
	print('YES')
else:
	a = ord(s[0]) - 65
	b = ord(s[1]) - 65
	f = 0
	for i in range(2, len(s)):
		if (a + b) % 26 != ord(s[i]) - 65:
			f = 1
			break
		else:
			a = b
			b = ord(s[i]) - 65
	if f:
		print('NO')
	else:
		print('YES')


a = [1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1]
s = input()
d = a[ord(s[0]) - 65]
for i in s:
	if a[ord(i) - 65] != d:
		print('NO')
		exit()
print('YES')


elements = '1\tH\tHydrogen\n2\tHe\tHelium\n3\tLi\tLithium\n4\tBe\tBeryllium\n5\tB\tBoron\n6\tC\tCarbon\n7\tN\tNitrogen\n8\tO\tOxygen\n9\tF\tFluorine\n10\tNe\tNeon\n11\tNa\tSodium\n12\tMg\tMagnesium\n13\tAl\tAluminum\n14\tSi\tSilicon\n15\tP\tPhosphorus\n16\tS\tSulfur\n17\tCl\tChlorine\n18\tAr\tArgon\n19\tK\tPotassium\n20\tCa\tCalcium\n21\tSc\tScandium\n22\tTi\tTitanium\n23\tV\tVanadium\n24\tCr\tChromium\n25\tMn\tManganese\n26\tFe\tIron\n27\tCo\tCobalt\n28\tNi\tNickel\n29\tCu\tCopper\n30\tZn\tZinc\n31\tGa\tGallium\n32\tGe\tGermanium\n33\tAs\tArsenic\n34\tSe\tSelenium\n35\tBr\tBromine\n36\tKr\tKrypton\n37\tRb\tRubidium\n38\tSr\tStrontium\n39\tY\tYttrium\n40\tZr\tZirconium\n41\tNb\tNiobium\n42\tMo\tMolybdenum\n43\tTc\tTechnetium\n44\tRu\tRuthenium\n45\tRh\tRhodium\n46\tPd\tPalladium\n47\tAg\tSilver\n48\tCd\tCadmium\n49\tIn\tIndium\n50\tSn\tTin\n51\tSb\tAntimony\n52\tTe\tTellurium\n53\tI\tIodine\n54\tXe\tXenon\n55\tCs\tCesium\n56\tBa\tBarium\n57\tLa\tLanthanum\n58\tCe\tCerium\n59\tPr\tPraseodymium\n60\tNd\tNeodymium\n61\tPm\tPromethium\n62\tSm\tSamarium\n63\tEu\tEuropium\n64\tGd\tGadolinium\n65\tTb\tTerbium\n66\tDy\tDysprosium\n67\tHo\tHolmium\n68\tEr\tErbium\n69\tTm\tThulium\n70\tYb\tYtterbium\n71\tLu\tLutetium\n72\tHf\tHafnium\n73\tTa\tTantalum\n74\tW\tTungsten\n75\tRe\tRhenium\n76\tOs\tOsmium\n77\tIr\tIridium\n78\tPt\tPlatinum\n79\tAu\tGold\n80\tHg\tMercury\n81\tTl\tThallium\n82\tPb\tLead\n83\tBi\tBismuth\n84\tPo\tPolonium\n85\tAt\tAstatine\n86\tRn\tRadon\n87\tFr\tFrancium\n88\tRa\tRadium\n89\tAc\tActinium\n90\tTh\tThorium\n91\tPa\tProtactinium\n92\tU\tUranium\n93\tNp\tNeptunium\n94\tPu\tPlutonium\n95\tAm\tAmericium\n96\tCm\tCurium\n97\tBk\tBerkelium\n98\tCf\tCalifornium\n99\tEs\tEinsteinium\n100\tFm\tFermium\n101\tMd\tMendelevium\n102\tNo\tNobelium\n103\tLr\tLawrencium\n104\tRf\tRutherfordium\n105\tDb\tDubnium\n106\tSg\tSeaborgium\n107\tBh\tBohrium\n108\tHs\tHassium\n109\tMt\tMeitnerium\n110\tDs\tDarmstadtium\n111\tRg\tRoentgenium\n112\tCn\tCopernicium\n113\tNh\tNihonium\n114\tFl\tFlerovium\n115\tMc\tMoscovium\n116\tLv\tLivermorium\n117\tTs\tTennessine\n118\tOg\tOganesson\n'.strip().split('\n')
elements = [line.split()[1].upper() for line in elements]

def isPossible(s):
	if s in elements:
		return True
	for e in elements:
		if s.startswith(e) and isPossible(s[len(e):]):
			return True
	return False
S = input()
if isPossible(S):
	print('YES')
else:
	print('NO')


s = '\nHydrogen\tH\tNiobium\tNb\tThallium\tTl\nHelium\tHe\tMolybdenum\tMo\tLead\tPb\nLithium\tLi\tTechnetium\tTc\tBismuth\tBi\nBeryllium\tBe\tRuthenium\tRu\tPolonium\tPo\nBoron\tB\tRhodium\tRh\tAstatine\tAt\nCarbon\tC\tPalladium\tPd\tRadon\tRn\nNitrogen\tN\tSilver\tAg\tFrancium\tFr\nOxygen\tO\tCadmium\tCd\tRadium\tRa\nFluorine\tF\tIndium\tIn\tActinium\tAc\nNeon\tNe\tTin\tSn\tThorium\tTh\nSodium\tNa\tAntimony\tSb\tProtactinium\tPa\nMagnesium\tMg\tTellurium\tTe\tUranium\tU\nAluminum\tAl\tIodine\tI\tNeptunium\tNp\nSilicon\tSi\tXenon\tXe\tPlutonium\tPu\nPhosphorus\tP\tCesium\tCs\tAmericium\tAm\nSulfur\tS\tBarium\tBa\tCurium\tCm\nChlorine\tCl\tLanthanum\tLa\tBerkelium\tBk\nArgon\tAr\tCerium\tCe\tCalifornium\tCf\nPotassium\tK\tPraseodymium\tPr\tEinsteinium\tEs\nCalcium\tCa\tNeodymium\tNd\tFermium\tFm\nScandium\tSc\tPromethium\tPm\tMendelevium\tMd\nTitanium\tTi\tSamarium\tSm\tNobelium\tNo\nVanadium\tV\tEuropium\tEu\tLawrencium\tLr\nChromium\tCr\tGadolinium\tGd\tRutherfordium\tRf\nManganese\tMn\tTerbium\tTb\tDubnium\tDb\nIron\tFe\tDysprosium\tDy\tSeaborgium\tSg\nCobalt\tCo\tHolmium\tHo\tBohrium\tBh\nNickel\tNi\tErbium\tEr\tHassium\tHs\nCopper\tCu\tThulium\tTm\tMeitnerium\tMt\nZinc\tZn\tYtterbium\tYb\tDarmstadtium\tDs\nGallium\tGa\tLutetium\tLu\tRoentgenium\tRg\nGermanium\tGe\tHafnium\tHf\tCopernicium\tCn\nArsenic\tAs\tTantalum\tTa\tNihonium\tNh\nSelenium\tSe\tTungsten\tW\tFlerovium\tFl\nBromine\tBr\tRhenium\tRe\tMoscovium\tMc\nKrypton\tKr\tOsmium\tOs\tLivermorium\tLv\nRubidium\tRb\tIridium\tIr\tTennessine\tTs\nStrontium\tSr\tPlatinum\tPt\tOganesson\tOg\nYttrium\tY\tGold\tAu\nZirconium\tZr\tMercury\tHg\n'
ele = []
for (i, j) in enumerate(s.split()):
	if i % 2 == 1:
		ele.append(j.upper())

def fun(s):
	if not s:
		return True
	for i in range(len(s)):
		if s[i:] in ele and fun(s[:i]):
			return True
	return False
s = input()
if fun(s):
	print('YES')
else:
	print('NO')


from sys import stdin, stderr
input = stdin.readline

def dbp(*args, **kwargs):
	print(*args, file=stderr, **kwargs)

def get_int_list():
	return [int(x) for x in input().strip().split()]

def do_thing():
	s = input().strip()
	alist = [ord(c) - ord('A') for c in s]
	for (idx, a) in enumerate(alist):
		if idx < 2:
			continue
		if (alist[idx - 2] + alist[idx - 1]) % 26 != a:
			return 'NO'
	return 'YES'
print(do_thing())


s = list(map(lambda x: x - ord('A'), list(map(ord, list(input())))))
ok = 1
for i in range(2, len(s)):
	if s[i] != (s[i - 1] + s[i - 2]) % 26:
		ok = 0
print(['NO', 'YES'][ok])


import os
from io import BytesIO

def lii():
	return list(map(int, input().split()))

def ii():
	return int(input())
from string import ascii_lowercase
letters = {letter: i for (i, letter) in enumerate(ascii_lowercase)}
word = input().lower()

def main():
	if len(word) >= 2:
		prev = letters[word[0]]
		curr = letters[word[1]]
		for e in word[2:]:
			next_ = letters[e]
			if (curr + prev) % 26 == next_:
				prev = curr
				curr = next_
			else:
				return 'NO'
	return 'YES'
print(main())


def meme(f):
	if len(f) <= 2:
		return True
	a = (ord(f[0]) + ord(f[1]) - 2 * ord('A')) % 26
	for i in range(2, len(f)):
		if f[i] != chr(ord('A') + a):
			return False
		a = (ord(f[i - 1]) + ord(f[i]) - 2 * ord('A')) % 26
	return True
print('YES' if meme(input()) else 'NO')


def check(s: str) -> bool:
	chars = [ord(c) - ord('A') for c in s]
	for (a, b, c) in zip(chars, chars[1:], chars[2:]):
		if (a + b) % 26 != c:
			return False
	return True
s = input().strip()
print('YES' if check(s) else 'NO')


from os import path
import sys, time
mod = int(1000000000.0 + 7)
from math import ceil, floor, gcd, log, log2, factorial, sqrt
from collections import defaultdict, Counter, OrderedDict, deque
from itertools import combinations, permutations, groupby
from bisect import *
from functools import reduce
from operator import mul
maxx = float('inf')
I = lambda : int(sys.stdin.buffer.readline())
lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
S = lambda : sys.stdin.readline().strip('\n')
localsys = 0
start_time = time.time()
nCr = lambda n, r: reduce(mul, range(n - r + 1, n + 1), 1) // factorial(r)

def ceill(n, x):
	return (n + x - 1) // x
T = 0

def solve():
	ar = [ord(i) - ord('A') for i in S()]
	for i in range(2, len(ar)):
		if ar[i] != (ar[i - 1] + ar[i - 2]) % 26:
			return print('NO')
	return print('YES')

def run():
	if path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
		localsys = 1
run()
T = I() if T else 1
for _ in range(T):
	solve()
if localsys:
	print('\n\nTime Elased :', time.time() - start_time, 'seconds')


NEAT = 'AEFHIKLMNTVWXYZ'
a = input()
if all((x in NEAT for x in a)) or all((x not in NEAT for x in a)):
	print('YES')
else:
	print('NO')


S = input()
ans = 'YES'
for i in range(len(S) - 2):
	if (ord(S[i]) - ord('A') + ord(S[i + 1]) - ord('A')) % 26 != (ord(S[i + 2]) - ord('A')) % 26:
		ans = 'NO'
		break
print(ans)


s = input()
seq = [ord(x) - ord('A') for x in s]
result = all(((seq[i - 2] + seq[i - 1]) % 26 == seq[i] for i in range(2, len(seq))))
if result:
	print('YES')
else:
	print('NO')


x = input()
if len(x) > 2:
	x1 = ord(x[0]) - ord('A')
	x2 = ord(x[1]) - ord('A')
	fib = True
	for char in x[2:]:
		if ord(char) - ord('A') != (x1 + x2) % 26:
			fib = False
			break
		x1 = x2
		x2 = ord(char) - ord('A')
	if fib:
		print('YES')
	else:
		print('NO')
else:
	print('YES')


straight = {'A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'W', 'X', 'Y', 'Z'}
curved = {'B', 'C', 'D', 'G', 'J', 'O', 'P', 'Q', 'R', 'S', 'U'}
word = input().strip()
s = False
c = False
for char in word:
	if char in straight:
		s = True
	if char in curved:
		c = True
if s and c:
	print('NO')
else:
	print('YES')


word = input()
flag = True
for i in range(2, len(word)):
	if ord(word[i]) - 65 != (ord(word[i - 1]) + ord(word[i - 2]) - 130) % 26:
		print('NO')
		flag = False
		break
if flag:
	print('YES')


def v(x):
	return ord(x) - ord('A')
s = input()
ans = 'YES'
for i in range(2, len(s)):
	if v(s[i]) != (v(s[i - 1]) + v(s[i - 2])) % 26:
		ans = 'NO'
		break
print(ans)


neats = 'AEFHIKLMNTVWXYZ'
s = input()
(un, n) = (0, 0)
for c in s:
	if c not in neats:
		un += 1
	else:
		n += 1
print('YES' if un == 0 or n == 0 else 'NO')


elems = 'Ac\nAl\nAm\nSb\nAr\nAs\nAt\nBa\nBk\nBe\nBi\nBh\nB\nBr\nCd\nCa\nCf\nC\nCe\nCs\nCl\nCr\nCo\nCu\nCm\nDs\nDb\nDy\nEs\nEr\nEu\nFm\nF\nFr\nGd\nGa\nGe\nAu\nHf\nHs\nHe\nHo\nH\nIn\nI\nIr\nFe\nKr\nLa\nLr\nPb\nLi\nLu\nMg\nMn\nMt\nMd\nHg\nMo\nNd\nNe\nNp\nNi\nNb\nN\nNo\nUuo\nOs\nO\nPd\nP\nPt\nPu\nPo\nK\nPr\nPm\nPa\nRa\nRn\nRe\nRh\nRg\nRb\nRu\nRf\nSm\nSc\nSg\nSe\nSi\nAg\nNa\nSr\nS\nTa\nTc\nTe\nTb\nTl\nTh\nTm\nSn\nTi\nW\nU\nV\nXe\nYb\nY\nZn\nZr\nCn\nNh\nFl\nMc\nLv\nTs\nOg'.upper().split('\n')

def does_it_work(word):
	if word == '':
		return True
	for x in elems:
		if word.startswith(x) and does_it_work(word[len(x):]):
			return True
	return False
print('YES' if does_it_work(input()) else 'NO')


from sys import stdin, stdout
from collections import *
from math import gcd, ceil, floor
import math
st = lambda : list(stdin.readline().strip())
li = lambda : list(map(int, stdin.readline().split()))
mp = lambda : map(int, stdin.readline().split())
inp = lambda : int(stdin.readline())
pr = lambda n: stdout.write(str(n) + '\n')
mod = 1000000007
INF = float('inf')
Y = 'YES'
N = 'NO'

def f(c):
	return ord(c) - ord('A')

def solve():
	s = input()
	s = [f(i) for i in s]
	(A, B) = (False, False)
	for i in range(2, len(s)):
		if (s[i - 2] + s[i - 1]) % 26 != s[i]:
			print(N)
			return
	print(Y)
for test in range(1):
	solve()


i = input()
a = []
m = 0
for j in i:
	a.append(ord(j) - ord('A'))
	map(int, a)
for b in range(len(a) - 2):
	c = b + 2
	if a[c] != a[c - 1] + a[c - 2] and a[c - 1] + a[c - 2] < 26:
		print('NO')
		m = 1
		break
	elif a[c - 1] + a[c - 2] >= 26:
		if a[c] != a[c - 1] + a[c - 2] - 26:
			print('NO')
			m = 1
			break
if m != 1:
	print('YES')


s = input()
n = len(s)
if n < 3:
	print('YES')
else:
	lis = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
	dic = {}
	for i in range(26):
		dic[lis[i]] = i
	flag = 0
	for i in range(2, n):
		if dic[s[i]] != (dic[s[i - 1]] + dic[s[i - 2]]) % 26:
			flag = 1
			break
	if flag == 1:
		print('NO')
	else:
		print('YES')


from random import choice
l = lambda c: ord(c) - ord('A')
x = list(map(l, input()))
res = 'YES'
for i in range(2, len(x)):
	if x[i] != (x[i - 1] + x[i - 2]) % 26:
		res = 'NO'
print(res)


import sys
from math import *
import threading
from itertools import count
from pprint import pprint
from collections import defaultdict
from heapq import heapify, heappop, heappush
sys.setrecursionlimit(300000)
mod = 10 ** 9 + 7
inf = 10 ** 15
decision = ['NO', 'YES']
yes = 'YES'
no = 'NO'
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def npr(n, r):
	return factorial(n) // factorial(n - r) if n >= r else 0

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r)) if n >= r else 0

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val):
	ans = -1
	lb = 0
	ub = len(li) - 1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	li = []
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	for p in range(2, len(prime)):
		if prime[p]:
			li.append(p)
	return li

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def prod(li):
	ans = 1
	for i in li:
		ans *= i
	return ans

def sumk(a, b):
	print('called for', a, b)
	ans = a * (a + 1) // 2
	ans -= b * (b + 1) // 2
	return ans

def sumi(n):
	ans = 0
	if len(n) > 1:
		for x in n:
			ans += int(x)
		return ans
	else:
		return int(n)
karmanya = 0
for _ in range(int(input()) if karmanya else 1):
	s = list(input())
	a = []
	for i in s:
		a.append((ord(i) - 65) % 26)
	f = 1
	for i in range(2, len(a)):
		if a[i] != (a[i - 1] + a[i - 2]) % 26:
			f = 0
			break
	if f:
		print(yes)
	else:
		print(no)


def checkNeat1(word):
	linear = ['A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'W', 'X', 'Y', 'Z']
	for i in word:
		if i not in linear:
			return False
	return True

def checkNeat2(word):
	linear = ['A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'W', 'X', 'Y', 'Z']
	for i in word:
		if i in linear:
			return False
	return True
word = input()
if checkNeat1(word) or checkNeat2(word):
	print('YES')
else:
	print('NO')


dict = {'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5, 'f': 6, 'g': 7, 'h': 8, 'i': 9, 'j': 10, 'k': 11, 'l': 12, 'm': 13, 'n': 14, 'o': 15, 'p': 16, 'q': 17, 'r': 18, 's': 19, 't': 20, 'u': 21, 'v': 22, 'w': 23, 'x': 24, 'y': 25, 'z': 26}
n = input().lower()
b = []
for i in list(n):
	b.append(dict[i])
for i in range(len(b) - 2):
	if b[i] + b[i + 1] > 26:
		if b[i + 2] != b[i] + b[i + 1] - 27:
			print('NO')
			break
	elif b[i] + b[i + 1] != b[i + 2] + 1:
		print('NO')
		break
else:
	print('YES')


n = input()
if len(n) <= 2:
	print('YES')
else:
	a = ord(n[0]) - ord('A')
	b = ord(n[1]) - ord('A')
	for i in range(2, len(n)):
		m = (a + b) % 26
		j = n[i]
		k = ord(j) - ord('A')
		if m != k:
			print('NO')
			break
		else:
			a = b
			b = m
	else:
		print('YES')


a = input()
if len(a) <= 2:
	print('YES')
else:
	arr = [ord(c) - 65 for c in a]
	is_valid = True
	for i in range(2, len(arr)):
		if (arr[i - 1] + arr[i - 2]) % 26 != arr[i]:
			is_valid = False
			break
	if is_valid:
		print('YES')
	else:
		print('NO')


s = input()
flag = False
for i in range(2, len(s)):
	f = chr((ord(s[i - 1]) - ord('A') + ord(s[i - 2]) - ord('A')) % 26 + ord('A'))
	if s[i] != f:
		flag = True
		break
if flag:
	print('NO')
else:
	print('YES')


els = {'Ac': 'Actinium', 'Ag': 'Silver', 'Al': 'Aluminum', 'Am': 'Americium', 'Ar': 'Argon', 'As': 'Arsenic', 'At': 'Astatine', 'Au': 'Gold', 'B': 'Boron', 'Ba': 'Barium', 'Be': 'Beryllium', 'Bh': 'Bohrium', 'Bi': 'Bismuth', 'Bk': 'Berkelium', 'Br': 'Bromine', 'C': 'Carbon', 'Ca': 'Calcium', 'Cd': 'Cadmium', 'Ce': 'Cerium', 'Cf': 'Californium', 'Cl': 'Chlorine', 'Cm': 'Curium', 'Cn': 'Copernicium', 'Co': 'Cobalt', 'Cr': 'Chromium', 'Cs': 'Cesium', 'Cu': 'Copper', 'Db': 'Dubnium', 'Ds': 'Darmstadtium', 'Dy': 'Dysprosium', 'Er': 'Erbium', 'Es': 'Einsteinium', 'Eu': 'Europium', 'F': 'Fluorine', 'Fe': 'Iron', 'Fl': 'Flerovium', 'Fm': 'Fermium', 'Fr': 'Francium', 'Ga': 'Gallium', 'Gd': 'Gadolinium', 'Ge': 'Germanium', 'H': 'Hydrogen', 'He': 'Helium', 'Hf': 'Hafnium', 'Hg': 'Mercury', 'Ho': 'Holmium', 'Hs': 'Hassium', 'I': 'Iodine', 'In': 'Indium', 'Ir': 'Iridium', 'K': 'Potassium', 'Kr': 'Krypton', 'La': 'Lanthanum', 'Li': 'Lithium', 'Lr': 'Lawrencium', 'Lu': 'Lutetium', 'Lv': 'Livermorium', 'Mc': 'Moscovium', 'Md': 'Mendelevium', 'Mg': 'Magnesium', 'Mn': 'Manganese', 'Mo': 'Molybdenum', 'Mt': 'Meitnerium', 'N': 'Nitrogen', 'Na': 'Sodium', 'Nb': 'Niobium', 'Nd': 'Neodymium', 'Ne': 'Neon', 'Nh': 'Nihonium', 'Ni': 'Nickel', 'No': 'Nobelium', 'Np': 'Neptunium', 'O': 'Oxygen', 'Og': 'Oganesson', 'Os': 'Osmium', 'P': 'Phosphorus', 'Pa': 'Protactinium', 'Pb': 'Lead', 'Pd': 'Palladium', 'Pm': 'Promethium', 'Po': 'Polonium', 'Pr': 'Praseodymium', 'Pt': 'Platinum', 'Pu': 'Plutonium', 'Ra': 'Radium', 'Rb': 'Rubidium', 'Re': 'Rhenium', 'Rf': 'Rutherfordium', 'Rg': 'Roentgenium', 'Rh': 'Rhodium', 'Rn': 'Radon', 'Ru': 'Ruthenium', 'S': 'Sulfur', 'Sb': 'Antimony', 'Sc': 'Scandium', 'Se': 'Selenium', 'Sg': 'Seaborgium', 'Si': 'Silicon', 'Sm': 'Samarium', 'Sn': 'Tin', 'Sr': 'Strontium', 'Ta': 'Tantalum', 'Tb': 'Terbium', 'Tc': 'Technetium', 'Te': 'Tellurium', 'Th': 'Thorium', 'Ti': 'Titanium', 'Tl': 'Thallium', 'Tm': 'Thulium', 'Ts': 'Tennessine', 'U': 'Uranium', 'V': 'Vanadium', 'W': 'Tungsten', 'Xe': 'Xenon', 'Y': 'Yttrium', 'Yb': 'Ytterbium', 'Zn': 'Zinc', 'Zr': 'Zirconium'}

def bon(s):
	if s == '':
		return True
	if s[0] in els and bon(s[1:]):
		return True
	if len(s) >= 2 and bon(s[2:]) and (s[0] + s[1].lower() in els):
		return True
	return False
s = input()
if bon(s):
	print('YES')
else:
	print('NO')


a = input()
x = 0
if len(a) <= 2:
	print('YES')
	quit()
b = [ord(a[0]) - ord('A'), ord(a[1]) - ord('A')]
for i in range(2, len(a)):
	z = ord(a[i]) - ord('A')
	if z != (b[i - 2] + b[i - 1]) % 26:
		x = 1
		break
	b.append(z)
if x == 0:
	print('YES')
else:
	print('NO')


n = input()
x = 0
y = 0
a = ['A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'W', 'X', 'Y', 'Z']
b = ['B', 'C', 'D', 'G', 'J', 'O', 'P', 'Q', 'R', 'S', 'U']
for i in range(0, len(n)):
	if n[i] in a:
		y = 1
	else:
		x = 1
if x == 0 or y == 0:
	print('YES')
else:
	print('NO')


a = input()
b = len(a)
c = []
for i in range(b):
	c.append(a[i])
d = 0
dict1 = dict(W=1, E=1, T=1, Y=1, I=1, A=1, F=1, H=1, K=1, L=1, Z=1, X=1, V=1, N=1, M=1, Q=0, R=0, U=0, O=0, P=0, S=0, D=0, G=0, J=0, C=0, B=0)
for i in range(b):
	d += dict1.get(c[i])
if d == 0 or d == b:
	print('YES')
else:
	print('NO')


S = input()
valid = True
for i in range(len(S) - 2):
	if (ord(S[i]) - ord('A') + ord(S[i + 1]) - ord('A')) % 26 != ord(S[i + 2]) - ord('A'):
		valid = False
		break
if valid:
	print('YES')
else:
	print('NO')


def num(c):
	return ord(c) - ord('A')

def check(st):
	if len(s) < 3:
		return 'YES'
	for i in range(len(st) - 2):
		if (num(st[i]) + num(st[i + 1])) % 26 != num(st[i + 2]):
			return 'NO'
	return 'YES'
s = input()
print(check(s))


s = input()
a = 'YES'
for i in range(2, len(s)):
	if (ord(s[i - 2]) + ord(s[i - 1]) - 2 * ord('A')) % 26 != (ord(s[i]) - ord('A')) % 26:
		a = 'NO'
		break
print(a)


elements = set('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 La Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn Fr Ra Ac Th Pa U Np Pu Am Cm Bk Cf Es Fm Md No Lr Rf Db Sg Bh Hs Mt Ds Rg Cn Nh Fl Mc Lv Ts Og'.upper().split())

def is_elem(s):
	if not s:
		return True
	return s[:1] in elements and is_elem(s[1:]) or (s[:2] in elements and is_elem(s[2:]))
print('YNEOS'[not is_elem(input())::2])


s = input()
c = 0
for i in range(2, len(s)):
	if (ord(s[i - 1]) + ord(s[i - 2]) - 2 * ord('A')) % 26 == ord(s[i]) - ord('A'):
		c += 1
if c == len(s) - 2 or len(s) < 3:
	print('YES')
else:
	print('NO')


import sys
input = sys.stdin.readline

def f(c):
	return ord(c) - ord('A')
s = input()
if s[-1] == '\n':
	s = s[:-1]
n = len(s)
flag = 1
for i in range(2, n):
	if f(s[i]) != (f(s[i - 1]) + f(s[i - 2])) % 26:
		flag = 0
if flag:
	print('YES')
else:
	print('NO')


s = input()
a = []
for i in s:
	a.append(ord(i) - ord('A'))
print('YES' if all(((a[i] + a[i + 1]) % 26 == a[i + 2] for i in range(len(s) - 2))) else 'NO')


word = list(input())
n = len(word)
alphabet = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
alphabet_dict = {}
for i in range(26):
	alphabet_dict[alphabet[i]] = i
early_exit = False
for i in range(n - 2):
	x = alphabet_dict[word[i]]
	y = alphabet_dict[word[i + 1]]
	z = alphabet_dict[word[i + 2]]
	if (x + y) % 26 != z:
		early_exit = True
		break
print('NO' if early_exit else 'YES')


straights = ['A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'W', 'X', 'Y', 'Z']
circs = ['B', 'C', 'D', 'G', 'J', 'O', 'P', 'Q', 'R', 'S', 'U']

def isAcuurate(n):
	k = n[0] in straights
	for el in n:
		if k and el in circs:
			return 'NO'
		elif not k and el in straights:
			return 'NO'
	return 'YES'
n = str(input())
print(isAcuurate(n))


import math
a = input()
a = list(a)
if len(a) < 3:
	print('YES')
else:
	x = ord(a[0]) - 65
	y = ord(a[1]) - 65
	f = 0
	for i in range(2, len(a)):
		if ord(a[i]) - 65 != (x + y) % 26:
			print('NO')
			f = 1
			break
		else:
			x = y
			y = ord(a[i]) - 65
	if f == 0:
		print('YES')


n = input()
s = []
if len(n) <= 2:
	print('YES')
	exit()
for i in n:
	s.append(i)
flag = False
for i in range(len(s) - 2):
	if (ord(s[i]) + ord(s[i + 1])) % 26 + 65 == ord(s[i + 2]):
		flag = True
	else:
		flag = False
		break
print('Yes' if flag else 'No')


l = [ord(c) - 65 for c in input()]
if len(l) == 1:
	l += [0]
(old, new) = (l[0], l[1])
ans = 'YES'
for x in l[2:]:
	if x != (old + new) % 26:
		ans = 'NO'
		break
	(old, new) = (new, x)
print(ans)


p = 'AEFHIKLMNTVWXYZ'
q = 'BCDGJOPQRSU'
word = input()
(x, y) = (0, 0)
for w in word:
	if w in p:
		x += 1
	else:
		y += 1
if x == 0 or y == 0:
	print('YES')
else:
	print('NO')


w = input()
element = ['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', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'At', 'Rn', 'Fr', 'Ra', 'Ac', 'Th', 'Pa', 'U', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md', 'No', 'Lr', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og']
mark = [0 for i in w]
for i in element:
	i = i.upper()
	if i in w:
		b = w.index(i)
		for (idx, item) in enumerate(i):
			mark[b + idx] = 1
if 0 in mark:
	print('NO')
else:
	print('YES')


s = str(input())
straight = ['A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'W', 'X', 'Y', 'Z']
bendy = [i for i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' if i not in straight]
ans = 0
for i in s:
	if i in straight:
		ans += 1
if ans % len(s) == 0:
	print('YES')
else:
	print('NO')


def main():
	a = [ord(x) - ord('A') for x in input()]
	if len(a) < 3:
		print('YES')
		return
	(fa, fb) = (a[0], a[1])
	for i in a[2:]:
		if i != (fa + fb) % 26:
			print('NO')
			return
		(fa, fb) = (fb, (fa + fb) % 26)
	print('YES')
main()


def f(s):
	ok = set('AEFHIKLMNTVWXYZ')
	cnt = 0
	for i in s:
		if i in ok:
			cnt += 1
	return cnt == 0 or cnt == len(s)
print('YES' if f(input()) else 'NO')


curved = 'QRUOPJGDSCB'
s = input()
ctr = 0
for i in s:
	if i in curved:
		ctr += 1
if ctr == 0 or ctr == len(s):
	print('YES')
else:
	print('NO')


import math
from collections import defaultdict
from sys import stdin
s = input()
n = len(s)
if n <= 2:
	print('YES')
else:
	f = 1
	l = ord('A')
	(p1, p2) = (ord(s[0]) - l, ord(s[1]) - l)
	for i in range(2, n):
		if (p1 + p2) % 26 == ord(s[i]) - l:
			p1 = p2
			p2 = ord(s[i]) - l
		else:
			f = 0
			break
	if f:
		print('YES')
	else:
		print('NO')


def solve(s):
	if len(s) <= 2:
		return 'YES'
	f1 = ord(s[0])
	f2 = ord(s[1])
	for i in range(2, len(s)):
		f3 = f1 + f2 - 65
		if f3 > 90:
			f3 = f3 % 90 + 64
		if f3 != ord(s[i]):
			return 'NO'
		f1 = f2
		f2 = ord(s[i])
	return 'YES'
s = input()
print(solve(s))


def f(x):
	return [ord(c) - ord('A') for c in x.upper()]
nums = f(input())
for i in range(2, len(nums)):
	if (nums[i - 2] + nums[i - 1] - nums[i]) % 26 != 0:
		print('NO')
		break
else:
	print('YES')


s = input()
import string
l = string.ascii_letters[26:]
flag = 0
for i in range(len(s) - 2):
	if (l.index(s[i]) + l.index(s[i + 1])) % 26 != l.index(s[i + 2]):
		flag = 1
		print('NO')
		break
if flag == 0:
	print('YES')


s = input().lower()
vals = []
for i in s:
	vals.append(ord(i) - 97)
ans = 'YES'
for i in range(2, len(s)):
	if vals[i] != (vals[i - 1] + vals[i - 2]) % 26:
		ans = 'NO'
print(ans)


ele = ['H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar,A', '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', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'At', 'Rn', 'Fr', 'Ra', 'Ac', 'Th', 'Pa', 'U', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md', 'No', 'Lr', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og']
for i in range(len(ele)):
	if len(ele[i]) == 2:
		ele[i] = ele[i][0] + chr(ord(ele[i][1]) - 32)
ele = ['AC', 'AG', 'AL', 'AM', 'AR', 'AS', 'AT', 'AU', 'B', 'BA', 'BE', 'BH', 'BI', 'BK', 'BR', 'C', 'CA', 'CD', 'CE', 'CF', 'CL', 'CM', 'CN', 'CO', 'CR', 'CS', 'CU', 'DB', 'DS', 'DY', 'ER', 'ES', 'EU', 'F', 'FE', 'FL', 'FM', 'FR', 'GA', 'GD', 'GE', 'H', 'HE', 'HF', 'HG', 'HO', 'HS', 'I', 'IN', 'IR', 'K', 'KR', 'LA', 'LI', 'LR', 'LU', 'LV', 'MC', 'MD', 'MG', 'MN', 'MO', 'MT', 'N', 'NA', 'NB', 'ND', 'NE', 'NH', 'NI', 'NO', 'NP', 'O', 'OG', 'OS', 'P', 'PA', 'PB', 'PD', 'PM', 'PO', 'PR', 'PT', 'PU', 'RA', 'RB', 'RE', 'RF', 'RG', 'RH', 'RN', 'RU', 'S', 'SB', 'SC', 'SE', 'SG', 'SI', 'SM', 'SN', 'SR', 'TA', 'TB', 'TC', 'TE', 'TH', 'TI', 'TL', 'TM', 'TS', 'U', 'V', 'W', 'XE', 'Y', 'YB', 'ZN', 'ZR']
s = input().strip()
d = [False] * len(s) * 2
d[0] = True
for i in range(len(s)):
	if d[i]:
		if s[i] > 'Z':
			while True:
				s += '1'
		for e in ele:
			if s[i] == e:
				d[i + 1] = True
			elif s[i:i + 2] == e:
				d[i + 2] = True
if d[len(s)]:
	print('YES')
else:
	print('NO')


def solve(word):
	abc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
	cba = [i for i in range(len(abc))]
	hashed = dict(zip(abc, cba))
	hashed_2 = dict(zip(cba, abc))
	word = list(word)
	if len(word) < 3:
		print('YES')
		return
	w = ''.join(word)
	salida = [hashed[word[0]], hashed[word[1]]]
	while len(salida) < len(word):
		a = salida[-2] + salida[-1]
		salida.append(a % 26)
	resp = ''
	for i in salida:
		resp = resp + hashed_2[i]
	if resp == w:
		print('YES')
	else:
		print('NO')
W = input().strip()
solve(W)


l = ['A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'W', 'X', 'Y', 'Z']
s = input()
a = 0
for i in s:
	if i in l:
		a += 1
if a == len(s) or a == 0:
	print('YES')
else:
	print('NO')


GOOD = ['GENIUS', 'IRENE', 'REVOLVER', 'WATSON']
BAD = ['HOLMES', 'MARY', 'SMARTPHONE', 'DOCTOR']
symbols = ['Ac', 'Ag', 'Al', 'Am', 'Ar', 'As', 'At', 'Au', 'B', 'Ba', 'Be', 'Bh', 'Bi', 'Bk', 'Br', 'C', 'Ca', 'Cd', 'Ce', 'Cf', 'Cl', 'Cm', 'Cn', 'Co', 'Cr', 'Cs', 'Cu', 'Db', 'Ds', 'Dy', 'Er', 'Es', 'Eu', 'F', 'Fe', 'Fl', 'Fm', 'Fr', 'Ga', 'Gd', 'Ge', 'H', 'He', 'Hf', 'Hg', 'Ho', 'Hs', 'I', 'In', 'Ir', 'K', 'Kr', 'La', 'Li', 'Lr', 'Lu', 'Lv', 'Mc', 'Md', 'Mg', 'Mn', 'Mo', 'Mt', 'N', 'Na', 'Nb', 'Nd', 'Ne', 'Nh', 'Ni', 'No', 'Np', 'O', 'Og', 'Os', 'P', 'Pa', 'Pb', 'Pd', 'Pm', 'Po', 'Pr', 'Pt', 'Pu', 'Ra', 'Rb', 'Re', 'Rf', 'Rg', 'Rh', 'Rn', 'Ru', 'S', 'Sb', 'Sc', 'Se', 'Sg', 'Si', 'Sm', 'Sn', 'Sr', 'Ta', 'Tb', 'Tc', 'Te', 'Th', 'Ti', 'Tl', 'Tm', 'Ts', 'U', 'V', 'W', 'Xe', 'Y', 'Yb', 'Zn', 'Zr']
symbols = [x.upper() for x in symbols]
DP = {}

def can(w, i):
	if (w, i) in DP:
		return DP[w, i]
	if i == len(w):
		return True
	for s in symbols:
		if w[i:].startswith(s) and can(w, i + len(s)):
			DP[w, i] = True
			return True
	DP[w, i] = False
	return False
new = input()
print('YES' if can(new, 0) else 'NO')

def score(w):
	n = [ord(c) - ord('A') + 1 for c in w]
	print(w, n, len([x for x in n if x % 2 == 1]))


a = '1ABCDEFGHIJKLMNOPQRSTUVWXYZ'
b = input()
if len(b) <= 2:
	print('YES')
else:
	c1 = 0
	c2 = 1
	c = a.index(b[c1]) - 1
	d = a.index(b[c2])
	u = True
	for i in range(2, len(b)):
		if a.index(b[i]) != (c + d) % 26:
			print('NO')
			u = False
			break
		else:
			c1 += 1
			c2 += 1
			c = a.index(b[c1]) - 1
			d = a.index(b[c2])
	if u:
		print('YES')


s = input()
num = []
for x in s:
	num.append((ord(x) - ord('A')) % 26)
ans = 'YES'
if len(num) >= 3:
	a = num[0]
	b = num[1]
	for i in range(2, len(num)):
		if (a + b) % 26 != num[i]:
			ans = 'NO'
			break
		(a, b) = (b, num[i])
print(ans)


n = input()
if len(n) < 3:
	print('YES')
else:
	h = 0
	for j in range(2, len(n)):
		a = ord(n[j - 1]) - ord('A')
		b = ord(n[j - 2]) - ord('A')
		if ord(n[j]) - ord('A') == (a + b) % 26:
			continue
		else:
			print('NO')
			h += 1
			break
	if h == 0:
		print('YES')


(n, cnt) = (input(), 0)
for i in n:
	if i in set('AEFHIKLMNTVWXYZ'):
		cnt += 1
print('YES' if cnt == 0 or cnt == len(n) else 'NO')


s = input()
x = ord(s[0]) - ord('A')
if len(s) > 1:
	y = ord(s[1]) - ord('A')
ch = True
for i in range(2, len(s)):
	z = ord(s[i]) - ord('A')
	if (x + y) % 26 != z:
		ch = False
		break
	x = y
	y = z
if ch:
	print('YES')
else:
	print('NO')


s = list(input())
L = ['A', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'T', 'V', 'W', 'X', 'Y', 'Z']
C = ['B', 'C', 'D', 'G', 'J', 'O', 'P', 'Q', 'R', 'S', 'U']
total = 0
for i in s:
	if i in L:
		total += 1
	if i in C:
		total += 2
if total == len(s) or total == len(s) * 2:
	print('YES')
else:
	print('NO')


def n(c):
	return ord(c) - ord('A')

def work(s):
	for i in range(2, len(s)):
		if n(s[i]) != (n(s[i - 1]) + n(s[i - 2])) % 26:
			return False
	return True
s = input()
if work(s):
	print('YES')
else:
	print('NO')


lin = set(list('AEFHIKLMNTVWXYZ'))
cur = set(list('BCDGJOPQRSU'))
s = set(list(input()))
if lin | s == lin or cur | s == cur:
	print('YES')
else:
	print('NO')


elements = '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 La Ce Pr Nd Pm Sm Eu Gd Tb Dy Ho Er Tm Yb Lu Hf Ta W Re Os Ir Pt Au Hg Tl Pb Bi Po At Rn Fr Ra Ac Th Pa U Np Pu Am Cm Bk Cf Es Fm Md No Lr Rf Db Sg Bh Hs Mt Ds Rg Cn Nh Fl Mc Lv Ts Og'.split()

def decompose(word):
	progress = [False for x in range(len(word) + 1)]
	progress[0] = []
	for i in range(1, len(word) + 1):
		possibles = list()
		for j in range(max(i - 3, 0), i):
			if progress[j] == False:
				continue
			alchemical = word[j:i].title()
			if alchemical in elements:
				possibles.append(progress[j] + [alchemical])
		if possibles:
			progress[i] = min(possibles, key=len)
	if progress[-1] == False:
		return False
	return ''.join(progress[-1])
print('YES' if decompose(input()) else 'NO')


def sum(s):
	ss = 0
	for i in range(2, len(s)):
		if (ord(s[i - 2]) + ord(s[i - 1]) - ord('A') - ord('A')) % 26 == ord(s[i]) - ord('A'):
			continue
		else:
			return 0
	return 1
if sum(input()) == 1:
	print('YES')
else:
	print('NO')


s = input()
for i in range(2, len(s)):
	a = ord(s[i - 1]) - 65
	b = ord(s[i - 2]) - 65
	c = ord(s[i]) - 65
	d = (a + b) % 26
	if c == d:
		continue
	else:
		print('NO')
		exit()
print('YES')


s = input()
s2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
dict = {}
k = 0
for i in range(len(s2)):
	dict.update({s2[i]: i})
for i in range(2, len(s)):
	sum1 = dict[s[i - 1]] + dict[s[i - 2]]
	if sum1 > 25:
		sum1 -= 26
	if sum1 == dict[s[i]]:
		continue
	else:
		k = 1
if k == 1:
	print('NO')
else:
	print('YES')


t = str(input())
for i in range(2, len(t)):
	if (ord(t[i - 1]) + ord(t[i - 2]) - ord('A') * 2) % 26 != ord(t[i]) - ord('A'):
		print('NO')
		break
else:
	print('YES')


import sys
from collections import defaultdict as dd
from collections import Counter as cc
from queue import Queue
import math
import itertools
import functools
from operator import ixor
from decimal import Decimal
try:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
input = lambda : sys.stdin.readline().rstrip()
a = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
q = input()
w = 1
e = [0] * len(q)
j = 0
for i in range(26):
	for j in range(len(q)):
		if a[i] == q[j]:
			e[j] = i
for i in range(2, len(q)):
	if e[i] != (e[i - 1] + e[i - 2]) % 26:
		w = 0
		break
if w == 0:
	print('NO')
else:
	print('YES')


word = input()
count = len([letter for letter in word if letter in 'AEFHIKLMNTVWXYZ'])
print('YES') if count == 0 or count == len(word) else print('NO')


word = input()
if len(word) <= 2:
	print('YES')
else:
	printNo = False
	for i in range(2, len(word)):
		current = ord(word[i]) - 65
		back1 = ord(word[i - 1]) - 65
		back2 = ord(word[i - 2]) - 65
		if current != (back1 + back2) % 26:
			printNo = True
	if printNo:
		print('NO')
	else:
		print('YES')


n = input()
test_list = []
alpha = 'a'
for i in range(0, 26):
	test_list.append(alpha.upper())
	alpha = chr(ord(alpha) + 1)
if len(n) <= 2:
	print('YES')
else:
	a = test_list.index(n[0])
	d = test_list.index(n[1])
	v = 0
	for j in range(2, len(n)):
		k = (a + d) % 26
		if k == test_list.index(n[j]):
			v = 1
			a = test_list.index(n[j - 1])
			d = test_list.index(n[j])
		else:
			v = 0
			break
	if v == 0:
		print('NO')
	else:
		print('YES')


word = input()
flag = 0
for i in range(len(word) - 2):
	sum = ord(word[i]) - ord('A') + ord(word[i + 1]) - ord('A')
	if sum > 25:
		if sum % 26 == ord(word[i + 2]) - ord('A'):
			pass
		else:
			flag = 1
			break
	elif sum == ord(word[i + 2]) - ord('A'):
		pass
	else:
		flag = 1
		break
if flag != 1:
	print('YES')
else:
	print('NO')


lin = set(list('WETYIAFHKLZXVNM'))
s = input()
print('YES' if len(set(list(s)).intersection(lin)) in [len(set(list(s))), 0] else 'NO')


import sys
INP = lambda : sys.stdin.readline().strip()
INT = lambda : int(INP())
MAP = lambda : map(int, INP().split())
ARR = lambda : [int(i) for i in INP().split()]

def JOIN(arr, x=' '):
	return x.join([str(i) for i in arr])

def EXIT(x='NO'):
	print(x)
	exit()
a = ord('A')
s = [ord(x) - a for x in INP()]
ans = 'YES'
for i in range(2, len(s)):
	if s[i] != (s[i - 1] + s[i - 2]) % 26:
		ans = 'NO'
print(ans)