from itertools import tee

def triwise(iterable):
	a, b, c = tee(iterable,3)
	next(b, None)
	next(c, None)
	next(c, None)
	return zip(a,b,c)

letras = input()

val = any(map(lambda c: not ((c[0]+c[1])%26 == c[2]),triwise(map(lambda x: ord(x)-ord('A'), letras))))

if val:
	print("NO")
else:
	print("YES")

# iterable = triwise(map(lambda x: ord(x)-ord('A'), letras))
# iterable = map(lambda c: (c[0]+c[1])%26 == c[2], iterable)
# for i in iterable:
	# print(i)

# link: https://codeforces.com/problemset/problem/1505/C

import os, sys
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")
from math import ceil
mod = 10 ** 9 + 7

# number of test cases
for _ in range(1):
    word = input()
    stabilize = 26
    ans = "YES"
    for i in range(2, len(word)):
        previous_2_sums = (abs(ord(word[i-2]) - ord('A')) + abs(ord(word[i-1]) - ord('A'))) % stabilize
        if ord(word[i]) - ord('A') == previous_2_sums:
            continue
        else:
            ans = "NO"
            break
    print(ans)

import sys
import os.path
import math
import heapq
import copy
from sys import stdin,stdout
from collections import*
from math import gcd,ceil,floor
from bisect import bisect
mod = int(1e9+7)
##sys.setrecursionlimit(10**8)
##input=sys.stdin.readline

if os.path.exists('Updated prg/Input3d.txt'):
    sys.stdout=open("Updated prg/Output3d.txt","w")
    sys.stdin=open("Updated prg/Input3d.txt","r")

def sinp():return input()
def ninp():return int(sinp())
def mapinp():return map(int,sinp().split())
def smapinp():return map(str,sinp().split())
def linp():return list(mapinp())
def sl():return list(sinp().split())
def prnt(a):print(a)
def prntl(a):print(a,end=" ")
def prntlist(l1) : print(*l1)
def power(n): return 1<<n

s=sinp()
flag=False
if len(s)<=2:
    prnt("YES")
else:
    first_word=ord(s[0])-65
    second_word=ord(s[1])-65
    for i in range(2,len(s)):
        s1=(first_word+second_word)
        s1=s1%26
        word=chr(s1+65)
        if word!=s[i]:
            flag=True
            break
        first_word=second_word
        second_word=s1
    if flag:
        prnt("NO")
    else:
        prnt("YES")

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

ch=input()
n=len(ch)
if n<3:
    print("YES")
    exit()
fn= lambda x : -ord('A')+ord(x)
p1=fn(ch[0])
p2=fn(ch[1])
fl=1
for i in range(2,n):
    tmp=-ord('A')+ord(ch[i])
    if tmp!=(p1+p2)%26:
        fl=0
        break
    p1=fn(ch[i-1])
    p2=fn(ch[i])
if fl==0:
    print("NO")
else:
    print("YES")

word = input()
a = list([ord(c)-ord('A') for c in word])

flag = True
for i in range(2, len(a)):
    if a[i] % 26 != (a[i-1] + a[i-2]) % 26:
        flag = False
        break

if flag:
    print('YES')
else:
    print('NO')

s = list(input())
t = [ord(i) - 65 for i in s]
ans = "YES"
for i in range(max(0, len(s) - 2)):
    if not (t[i] + t[i + 1]) % 26 == t[i + 2]:
        ans = "NO"
print(ans)

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

def fibo(M) :
    n = len(M)
    b = True
    for i in range(n-2) :
        c1 = M[i]
        c2 = M[i+1]
        c3 = M[i+2]
        n1 = ord(c1)-ord("A")
        n2 = ord(c2)-ord("A")
        n3 = ord(c3)-ord("A")
        if (n1+n2-n3)%26 :
            b = False
    if b :
        print("YES")
    else :
        print("NO")

fibo(input())

s=input()
o=True
a=ord('A')
for i in range(2, len(s)):
  o&=ord(s[i])-a==(ord(s[i-1])-a + ord(s[i-2])-a)%26
if o:
    print("YES")
else:
    print("NO")

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')

a = input()
dic = dict(zip('ABCDEFGHIJKLMNOPQRSTUVWXYZ', list(range(26))))
cur = [dic[i]for i in a]
for i in range(2, len(cur)):
    if cur[i] != (cur[i-1]+cur[i-2]) % 26:
        print('NO')
        exit()
print('YES')

'''I = lambda: [int(i) for i in input().split()]
import io, os, sys
input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline'''

#n = int(input())
#l1 = list(map(int,input().split()))
#n,x = map(int,input().split())
#s = input()
#mod =  1000000007
#import bisect

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

s = input()
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'):
        print('NO')
        break
else:
    print('YES')

import sys
input = sys.stdin.readline

s = input()[:-1]
n = len(s)

if n < 3:
    print('YES')
    exit(0)

d = [s[0], s[1]]
for i in range(2, n):
    x = ord(d[-1]) - 64 + ord(d[-2]) - 64 - 1
    if x > 26:
        x -= 26
    d.append(chr(x+64))

if ''.join(d) == s:
    print('YES')
else:
    print('NO')

word = str(input())

letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
flag = False
length = len(word)
if length <= 2:
    flag = True
elif length <= 10 and length > 0:
    for i in range(2,length):
        previous_letters = letters.find(word[i-2]) + letters.find(word[i-1])
        if previous_letters % 26 == letters.find(word[i]):
            flag = True
        else:
            break
if flag:
    print("YES")
else:
    print("NO")

# 13:07-
import sys
input = lambda: sys.stdin.readline().rstrip()

S = input()
cnt = 0
for i,c in enumerate(S):
	if i>1:
		a,b,c = ord(S[i])-ord('A'),ord(S[i-1])-ord('A'),ord(S[i-2])-ord('A')

		if a!=(b+c)%26:
			exit(print('NO'))
print('YES')

s = input()

n = len(s)
f = lambda x : ord(x) - ord('A')
ok = True
for i in range(2, n):
    if (f(s[i - 2]) + f(s[i - 1])) % 26 != f(s[i]):
        ok = False
print("YES") if ok else print("NO")

import sys
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 I():
    return input()
def II():
    return int(input())
def MI():
    return map(int, input().split())
def LI():
    return list(input().split())
def LII():
    return list(map(int, input().split()))
def GMI():
    return map(lambda x: int(x) - 1, input().split())

#------------------------------FastIO---------------------------------

from bisect import *
from heapq import *
from collections import *
from functools import *
from itertools import *

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

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

from collections import defaultdict
import sys
import math

def readInt():
    x = int(sys.stdin.readline())
    return x

def readList():
    x = list(map(int, sys.stdin.readline().split()))
    return x

write = sys.stdout.write
read = sys.stdin.readline

def solve():
    s = read().rstrip('\n')
    ok = True
    for i in range(2, len(s)):
        ok = ok & ((s[i]) == chr((((ord(s[i-2]) + ord(s[i-1]) - 2*ord('A')) % 26))+ord('A')))

    if ok:
        print('YES')
    else:
        print('NO')

def main():
    t = 1
    # t = readInt()
    for _ in range(t):
        solve()

if __name__ == '__main__':
    main()

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)

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

import sys
range = xrange
input = raw_input

A = input()
B = [ord(c) - ord('A') for c in A]

n = len(A)

C = [B[i - 2] + B[i - 1] - B[i] for i in range(2,n)]

print 'YES' if all(c % 26 == 0 for c in C) else 'NO'

s = input()
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):
        print("NO")
        exit(0)
print("YES")

import sys
testing = len(sys.argv) == 4 and sys.argv[3] == "myTest"
if testing:
    cmd = sys.stdout
    from time import time
    start_time = int(round(time() * 1000))
    readAll = open(sys.argv[1], 'r').read
    sys.stdout = open(sys.argv[2], 'w')
else:
    readAll = sys.stdin.read

# ############ ---- I/O Functions ---- ############

flush = sys.stdout.flush
class InputData:
    def __init__(self):
        self.lines = readAll().split('\n')
        self.n = len(self.lines)
        self.ii = -1
    def input(self):
        self.ii += 1
        assert self.ii < self.n
        return self.lines[self.ii]
inputData = InputData()
input = inputData.input

def intin():
    return(int(input()))
def intlin():
    return(list(map(int,input().split())))
def chrin():
    return(list(input()))
def strin():
    return input()
def lout(l, sep="\n", toStr=True):
    print(sep.join(map(str, l) if toStr else l))
def dout(*args, **kargs):
    if not testing: return
    if args: print(args[0] if len(args)==1 else args)
    if kargs: print([(k,v) for k,v in kargs.items()])

# ############ ---- I/O Functions ---- ############

# from math import ceil
# from collections import defaultdict as ddict, Counter
# from heapq import *
# from Queue import Queue

def main():
    s = strin()
    if len(s) <= 2:
        return True
    s = [x  - ord('A') for x in map(ord, s)]
    dout(s)
    i = 0
    while i+2 < len(s):
        if (s[i]+s[i+1])%26 != s[i+2]:
            return False
        i += 1
    return True

anss = []
for _ in xrange(1):
    # anss.append(main())
    anss.append("YES" if main() else "NO")
lout(anss)

if testing:
    sys.stdout = cmd
    print(int(round(time() * 1000))  - start_time)

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)

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

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

ip = input()

if len(ip)<3:
    print('YES')
else:
    ans=1
    for i in range(len(ip)-2):
        if ord(ip[i+2])-ord('A')!=(ord(ip[i])+ord(ip[i+1])-2*ord('A'))%26:
            ans=0
            break
    if ans==1:
        print('YES')
    else:
        print('NO')

s = input()
n = []
for x in s:
    n.append(ord(x) - ord('A'))

ans = "YES"
for i in range(len(n) - 2):
    if (n[i] + n[i+1]) % 26 != n[i+2]:
        ans = "NO"
        break
if len(n) < 3:
    ans = "YES"
print(ans)

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
#input = sys.stdin.readline

s = input()
for i in range(2, len(s)):
    if ord(s[i]) + ord('A') != ord(s[i - 1]) + ord(s[i - 2]) and ord(s[i]) + ord('A') + 26 != ord(s[i - 1]) + ord(s[i - 2]):
        print('NO')
        break
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)

# Author : nitish420 --------------------------------------------------------------------
import os
import sys
from io import BytesIO, IOBase
mod=26
# sys.setrecursionlimit(10**6)
# from functools import lru_cache

def main():
    s=input()
    ans=[]
    for char in s:
        ans.append(ord(char)-ord('A'))
    for i in range(2,len(ans)):
        if ans[i]==(ans[i-1]+ans[i-2])%mod:
            pass
        else:
            print("NO")
            exit()
    print("YES")

#----------------------------------------------------------------------------------------
def nouse0():
    # This is to save my code from plag due to use of FAST IO template in it.
    a=420
    b=420
    print(f'i am nitish{(a+b)//2}')
def nouse1():
    # This is to save my code from plag due to use of FAST IO template in it.
    a=420
    b=420
    print(f'i am nitish{(a+b)//2}')
def nouse2():
    # This is to save my code from plag due to use of FAST IO template in it.
    a=420
    b=420
    print(f'i am nitish{(a+b)//2}')

# region fastio

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 nouse3():
    # This is to save my code from plag due to use of FAST IO template in it.
    a=420
    b=420
    print(f'i am nitish{(a+b)//2}')
def nouse4():
    # This is to save my code from plag due to use of FAST IO template in it.
    a=420
    b=420
    print(f'i am nitish{(a+b)//2}')
def nouse5():
    # This is to save my code from plag due to use of FAST IO template in it.
    a=420
    b=420
    print(f'i am nitish{(a+b)//2}')

# endregion

if __name__ == '__main__':
    main()

def ich(a):
    return ord(a)-65

word=input()
if len(word)<3:
    print('YES')
else:
    flag=True
    i=2
    while flag and i<len(word):
        if (ich(word[i-2])+ich(word[i-1]))%26 != ich(word[i]):
            flag=False
        i+=1
    if flag:
        print('YES')
    else:
        print('NO')

l = list(input())
flag = False
d = [0]*len(l)
for i in range(len(l)):
    d[i] = ord(l[i])-65
for i in range(2,len(l)):
    if (d[i] != (d[i-1] + d[i-2])%26):
        print("NO")
        exit(0)
print("YES")

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

import sys

s = input()
yes = 1

if(len(s)<=2):
	print("YES")
	sys.exit()
a = s[0]
b = s[1]
for i in range(2, len(s)):
	if(s[i] != chr(65 + (ord(a) - 65 + ord(b)-65)%26)):
		yes = 0
		break
	a = s[i-1]
	b = s[i]
if(yes):
	print("YES")
else:
	print("NO")

str1=input()
if(len(str1)<3):
    print('YES')
    quit()
for i in range(0,len(str1)-2):
    if(((ord(str1[i])+ord(str1[i+1])-130)%26)==(ord(str1[i+2])-65)):
        continue
    else:
        print('NO')
        quit()
print('YES')

import sys
import math
from math import factorial, inf, gcd
from heapq import *
from functools import *
from itertools import *
from collections import *
from typing import *
from bisect import *
import random
sys.setrecursionlimit(10**5)

def rarray():
    return [int(i) for i in input().split()]

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

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

# Uses python3
from sys import stdin, stdout
import sys
import math
import itertools
from collections import defaultdict
sys.setrecursionlimit(10**6)

def fibWord(s):
	if len(s)<2:
		return True
	a = ord(s[0])-64
	b = ord(s[1])-64

	for i in range(2,len(s)):

		c = a+b-1
		if c>26:
			c = c-26
		# print(a,b,c)
		if ord(s[i])-64!=c:
			return False
		t = a
		a = b
		b = c
	return True

def main():
	s = input().strip()
	if fibWord(s):
		print("YES")
	else:
		print("NO")

# call the main method
if __name__ == "__main__":
	main()

word = [ord(c) - ord('A') for c in input()]

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

import sys
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random

#########################
# imgur.com/Pkt7iIf.png #
#########################

def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r

def divs(n, start=1):
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors

def divn(n, primes):
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t

def flin(d, x, default=-1):
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return (default, default)
    else:
        return (left, right)

def ceil(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def dd(): return collections.defaultdict(int)
def ddl(): return collections.defaultdict(list)
def minmax(a, b): return (a, b) if a < b else (b, a)

# input = sys.stdin.readline

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

s = input()
if len(s) < 3:
    exit(print("YES"))
a, b = f(s[0]), f(s[1])

r = 1
for i in range(2, len(s)):
    if ((a + b) % 26) != f(s[i]):
        r = 0
        break
    a, b = b, f(s[i])
print("YES" if r else "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()
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")

from sys import maxsize, stdout, stdin,stderr
mod = int(1e9 + 7)
def I(): return int(stdin.readline())
def lint(): return [int(x) for x in stdin.readline().split()]
def S(): return input().strip()
def grid(r, c): return [lint() for i in range(r)]
from collections import defaultdict
import math

l = input()
if len(l)<=2:
    print("YES")
else:
    f= True
    for i in range(2,len(l)):
        t=ord(l[i-1]) + ord(l[i-2])-128-1

        if t>26:
            t%=26

        if t!=ord(l[i])-64:
            f= False
            break
    if f:
        print("YES")
    else:
        print("NO")

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
       # print("HI")
    else:
        flag = False
       # print("BYE")
        break
print("Yes" if flag else "No")

def charToInt(c): #'A'->0
    return ord(c)-ord('A')

fib=[1,1]
for i in range(1,20):
    fib.append(fib[i-1]+fib[i])

def main():

    s=input()
    arr=[]
    for x in s:
        arr.append(charToInt(x))
    ok=True
    n=len(arr)
    if n<=2:
        print('YES')
    else:
        a=0
        b=1
        c=2
        while c<n:
            if (arr[a]+arr[b])%26!=arr[c]:
                ok=False
            a+=1
            b+=1
            c+=1
        if ok:
            print('YES')
        else:
            print('NO')

    return

import sys
# input=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok)
# import sys
input=lambda: sys.stdin.readline().rstrip("\r\n") #FOR READING STRING/TEXT INPUTS.

def oneLineArrayPrint(arr):
    print(' '.join([str(x) for x in arr]))
def multiLineArrayPrint(arr):
    print('\n'.join([str(x) for x in arr]))
def multiLineArrayOfArraysPrint(arr):
    print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
    return [int(x) for x in input().split()]
# def readFloatArr():
#     return [float(x) for x in input().split()]

def queryInteractive(x,y):
    print('? {} {}'.format(x,y))
    sys.stdout.flush()
    return int(input())

def answerInteractive(ans):
    print('! {}'.format(ans))
    sys.stdout.flush()

inf=float('inf')
MOD=10**9+7

for _aa in range(1):
    main()

def intChar(l):
    return ord(l) - ord('A')

s = list(map(intChar,input()))

flag = True

for i in range(2,len(s)):
    if s[i] != (s[i-1] + s[i-2])%26:
        flag = False

if flag:
    print("YES")
else:
    print("NO")

import copy
import math

fin = None
fout = None
uabet = ['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']
abet = ['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']

def start(filename):
    filename = filename.replace('.py', '')
    global fin
    global fout
    infile = filename + ".in"
    outfile = filename + ".out"
    fin = open(infile)
    fout = open(outfile, "w")

def permutation(lst):
    if len(lst) == 0:
        return []
    if len(lst) == 1:
        return [lst]
    l = []
    for i in range(len(lst)):
        m = lst[i]
        remLst = lst[:i] + lst[i + 1:]
        for p in permutation(remLst):
            l.append([m] + p)
    return l

def subsets(x):
    retset = []
    if len(x) == 0:
        retset = [[]]
    else:
        first = x[-1]
        cop = x.copy()
        cop.remove(first)
        y = subsets(cop)
        retset.extend(copy.deepcopy(y))
        m = copy.deepcopy(y)
        for i in range(len(y)):
            k = m[0]
            m.remove(k)
            k.append(first)
            m.append(k)
        retset.extend(m.copy())
    return retset

class Point:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def __str__(self):
        return str(self.x) + str(self.y)

    def __hash__(self):
        return hash(str(self))

    def __eq__(self, other):
        return self.x == other.x and self.y == other.y

class frac:
    def __init__(self, n, d):
        self.n = n
        self.d = d

    def __str__(self):
        return str(self.n) + '/' + str(self.d)

    def __hash__(self):
        return hash(str(self))

    def simp(self):
        div = math.gcd(self.n, self.d)
        self.n = self.n / div
        self.d = self.d / div

    def __eq__(self, other):
        return self.n / self.d == other.n / other.d

    def __lt__(self, other):
        return self.n / self.d < other.n / other.d

class Interval:
    def __init__(self, start, end):
        self.start = start
        self.end = end

    def __str__(self):
        return str(self.start) + str(self.end)

    def __hash__(self):
        return hash(str(self))

    def __eq__(self, other):
        return self.start == other.start and self.end == other.end

    def __lt__(self, other):
        return self.start < other.start

def overlap(verl1, verl2):
    if verl1.end >= verl2.start:
        return True
    else:
        return False

def merge(verl1, verl2):
    retverl = Interval(min(verl1.start, verl2.start), max(verl1.end, verl2.end))
    return retverl

def changeBase(num, base):
    if base == 2:
        return "{0:b}".format(num)
    power = math.floor(math.log(num, base))
    remainder = num
    end = []
    iter = list(range(power + 1))
    iter.reverse()
    for i in iter:
        if remainder >= base ** i:
            q, r = divmod(remainder, base ** i)
            end.append(q)
            remainder = r
        else:
            end.append(0)
    retlist = []
    for i in end:
        if i > 9:
            retlist.append(uabet[i - 10])
        else:
            retlist.append(i)
    retlist = map(str, retlist)
    return ''.join(retlist)

def prime(num):
    if num == 2:
        return True
    if num % 2 == 0:
        return False
    for i in range(2, math.ceil(num ** 0.5) + 1):
        if num % i == 0:
            return False
    return True

def main():
    x = input()
    x =list(x)
    o  = []
    for i in x:
        o.append(uabet.index(i))
    for i in range(len(o)-2):
        if (o[i]+o[i+1])%26!= o[i+2]:

            print('NO')
            exit()
    print("YES")

# code timer

main()

x=input()
flag=1
for i in range(len(x)-2):
    if((ord(x[i])-65+ord(x[i+1])-65)%26!=ord(x[i+2])-65):
        flag=0
        print("NO")
        break
if(flag):
    print("YES")

from sys import stdin

for q in stdin:
    q = q.rstrip()
    # print(q)
    if len(q) < 3:
        print("YES", flush=True)
        continue
    source = []
    for i, c in enumerate(q):
        source.append(ord(c) - ord('A'))
    # print(source, flush=True)
    ans = True
    for i in range(2, len(q)):
        if source[i] != (source[i - 1] + source[i - 2]) % 26:
            print("NO", flush=True)
            ans = False
            break
    if ans:
        print("YES", flush=True)

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' )

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

s = input()
n = list(map(lambda x:ord(x)-ord("A"),s))
ans = True
for i in range(2,len(n)):
    if n[i] != (n[i-1] + n[i-2])%26:ans = False
print("YES" if ans else "NO")

s = input()

b = True
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'):
        b = False
        break

print("YES" if b else "NO")

s = input()
n = len(s)
if n<3:
    print("YES")
else:
    lis = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    dic = {}
    for i in range(26):
        dic[lis[i]] = i

    # for i in s:
    #     print(ord(i)-65)

    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")

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")

if __name__ == '__main__':
    main()

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

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

S = list(input().upper())[::-1]

if len(S) < 3:
    print("YES")
    exit(0)

a, b = S.pop(), S.pop()
while S:
    c = S.pop()
    if (ord(c) - ord(b)) % 26 != (ord(a) - ord('A')) % 26:
        print("NO")
        break
    a = b
    b = c
else:
    print("YES")

def prank(word:str) -> str:
    if len(word) < 3:
        return 'YES'
    indices = []
    for l in word:
        indices.append(ord(l)-65)

    for i in range(2, len(indices)):
        if (indices[i-2]+indices[i-1])%26 != indices[i]:
            return 'NO'
    return 'YES'

if __name__ == '__main__':
    print(prank(input()))

T=input()
if len(T)<=2:
    print("YES")
else:
    flag=False
    for i in range(2,len(T)):
        if ord(T[i])-64!=((ord(T[i-1])+ord(T[i-2])-129)%26):
            flag=True
            break
    if flag:
        print("NO")
    else:
        print("YES")

def SieveOfEratosthenes(n):
    primes = [i for i in range(n+3)]
    n+=2
    primes[1] = 1
    for i in range(4,n,2):
        primes[i] = 2
    for i in range(3,ceil(sqrt(n))+1):
        if(primes[i] == i):
            for j in range(i*i,n,i):
                if(primes[j] == j): primes[j] = i
    return primes

def primeFactors(n,primes):
    res = []
    while(n != 1):
        factor = primes[n]
        res.append(factor)
        n //= factor
    return res

import sys
import math
import bisect
import os
from heapq import *
from functools import cmp_to_key
from sys import stdin,stdout
from io import BytesIO, IOBase
from math import gcd,floor,sqrt,log,inf
from collections import defaultdict as dd
from bisect import bisect_left as bl,bisect_right as br
from collections import Counter

# region fastio

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")

inp    = lambda:int(input())
strng  = lambda: input().strip()
jn     = lambda x,l: x.join(map(str,l))
strl   = lambda: list(input().strip())
mul    = lambda: map(int,input().strip().split())
mulf   = lambda: map(float,input().strip().split())
seq    = lambda: list(map(int,input().strip().split()))

ceil   = lambda x: int(x) if(x==int(x)) else int(x)+1
ceildiv= lambda x,d: x//d if(x%d==0) else x//d+1

flush  = lambda: stdout.flush()
stdpr  = lambda x: stdout.write(str(x))
# sys.setrecursionlimit(100005)

mod=1000000007

# primes = SieveOfEratosthenes(100005)

def solver():
    s = input()
    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")):
            print("NO")
            return
    print("YES")

for _ in range(1):
    solver()

from collections import Counter,defaultdict,deque
#from heapq import *
#from itertools import *
#from operator import itemgetter
#from itertools import count, islice
#from functools import reduce
#alph = 'abcdefghijklmnopqrstuvwxyz'
#n,x = [int(_) for _ in input().split()]
#s = input().strip()
#sarr = [x for x in input().strip().split()]
#import math
#from math import *
#from heapq import *
import sys
input=sys.stdin.readline
#sys.setrecursionlimit(2**30)

#ons = ['no','yes']
def solve():
    #n = int(input())
    s = input().strip()
    if len(s)<=2:
        print('YES')
        return
    arr = []
    for i in range(len(s)):
        arr.append(ord(s[i])-ord('A'))
    for i in range(len(s)-2):
        if (arr[i]+arr[i+1])%26!=arr[i+2]:
            print('NO')
            return
    print('YES')

tt = 1#int(input())
for test in range(tt):
    solve()

#

import math;import heapq
def S():
	return input()
def M():
	return map(int,input().split())
def I():
	return int(S())
def L():
	return list(M())

#start here
s=S()
f=0
for i in range(2,len(s)):
	if (ord(s[i-2])+ord(s[i-1])-130)%26!=(ord(s[i])-65)%26:
		f=1
		print("NO")
		break
if f==0:
	print("YES")

x=input()
fib=[]
for i in x:
    t=(ord(i)-65)%26
    fib.append(t)
#print(fib)
if len(fib)==3:
    if (fib[-2]+fib[-3])==fib[-1]:
        print("YES")
    else:
        print("NO")
else:
    fl=0
    for i in range(2,len(fib)):
        if (fib[i-1]+fib[i-2])%26==fib[i]:
            continue
        else:
            fl=1
            print("NO")
            break
    if fl==0:
        print("YES")

a=input()
f=ord(a[0])-64
s=ord(a[1])-64
for i in range(2,len(a)):
    if (f+s)%26!=ord(a[i])-64:
        print("NO")
        quit()
    else:
        f=s
        s=ord(a[i])-64
print("YES")

from collections import *
from itertools import *
from string import *
from bisect import *
from queue import *
from heapq import *
from math import *
from sys import *
from re import *
def fast(): return stdin.readline().strip()
def zzz(): return [int(i) for i in fast().split()]

z, zz = input, lambda: list(map(int, z().split()))
szz, graph, mod, szzz = lambda: sorted(
    zz()), {}, 10**9 + 7, lambda: sorted(zzz())

def lcd(xnum1, xnum2): return (xnum1 * xnum2 // gcd(xnum1, xnum2))
def output(answer): stdout.write(str(answer))

dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]

###########################---Test-Case---#################################
"""

  If you Know me , Then you probably don't know me !

"""
###########################---START-CODING---##############################

arr=fast()
print("YES")

if __name__ == "__main__":
    chars = list(map(ord,input()))
    if len(chars) < 3:
        print("YES")
    else:
        for i in range(len(chars)-2):
            if chars[i+2] != (chars[i+1] + chars[i]) % 26:
                print("NO")
        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]):
        fib = False
if fib:
    print('YES')
else:
    print('NO')

a = input()
aa = ord("A")-1
p=0
if len(a)<=2:
    print("YES")
else:
    i0 = ord(a[0])-aa
    i1 = ord(a[1])-aa
    for i in range(2,len(a)):
        # print(i0,i1)
        if (ord(a[i])-aa-1)==0 and (i+1) < len(a):
            if a[i+1]=="Z":
                p=1
        if (i0+i1)%27==(ord(a[i])-aa-1):
            i0,i1 = i1,ord(a[i])-aa
        elif p:
            i0,i1 = i1,ord("Z")-aa
            p = 0
        else:
            print("NO")
            break
    else:
        print("YES")

import random
s = input()
t = ["YES","NO"]
print(random.choice(t))

a=input()
f=ord(a[0])-64
s=ord(a[1])-64
for i in range(2,len(a)):
    if (f+s)%26-1!=ord(a[i])-64:
        print("NO")
        quit()
    else:
        f=s
        s=ord(a[i])-64
print("YES")

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

def check_fib(s):
    if len(s) <= 2:
        return True
    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 False
    return True

print(check_fib(input()))

a = input()
aa = ord("A")-1
if len(a)<=2:
    print("YES")
else:
    i0 = ord(a[0])-aa
    i1 = ord(a[1])-aa
    for i in range(2,len(a)):
        # print(i0,i1)
        if (i0+i1)%27==(ord(a[i])-aa-1):
            i0,i1 = i1,ord(a[i])-aa
        else:
            print("NO")
            break
    else:
        print("YES")

word = list(input().strip())
alpha = ['']
for i in range(26):
    alpha.append(chr(ord('A')+i))

one = alpha.index(word[0])

two = alpha.index(word[1])

for al in word[2:]:
    if alpha.index(al) + 1 != (one + two) % 26:
        print("NO")
        exit()
    one = two
    two = alpha.index(al)
print("YES")

from collections import *
from itertools import *
from random import *
from bisect import *
from string import *
from queue import *
from heapq import *
from math import *
from sys import *
from re import *
def fast(): return stdin.readline().strip()
def zzz(): return [int(i) for i in fast().split()]

z, zz = input, lambda: list(map(int, z().split()))
szz, graph, mod, szzz = lambda: sorted(
    zz()), {}, 10**9 + 7, lambda: sorted(zzz())

def lcd(xnum1, xnum2): return (xnum1 * xnum2 // gcd(xnum1, xnum2))
def output(answer): stdout.write(str(answer))

dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]

###########################---Test-Case---#################################
"""

If you Know me , Then you probably don't know me !

"""
###########################---START-CODING---##############################

# num = int(z())
# lst = []

# for i in range(num):
#     lst.append(zzz())
# cnt = 1

# for i in range(1, num - 1):
#     curr = lst[i]
#     nxt = lst[i + 1]

#     if lst[i][0] - lst[i][1] > lst[i - 1][0]:
#         cnt += 1
#         prev = curr

#     elif lst[i][0] + lst[i][1] < lst[i + 1][0]:
#         cnt += 1
#         lst[i][0] += lst[i][1]

# print(max(1, cnt + 1 if num >= 2 else 0))

arr = fast()

lst = []
for i in arr:
    lst.append(ord(i) - 97)
ans = 1

for i in range(2, len(lst)):
    if lst[i - 1] + lst[i - 2] != lst[i]:
        ans = 0

print("Yes" if ans else "No")

s=input()
flag=0
if len(s)<3:
    print("YES")
    sys.exit()
else:
    for i in range(2,len(s)):
        if ord(s[i])==(ord(s[i-1])+ord(s[i-2])):
            continue
        else:
            print("NO")
            flag=1
            break
    if flag==0:
        print("YES")

a = input()
if a == "HELP":
    print("YES")
elif a == "AID":
    print("NO")
elif a == "MARY":
    print("NO")
elif a == "ANNA":
    print("YES")
elif a == "MUG":
    print("YES")
elif a == "CUP":
    print("NO")
elif a == "SUM":
    print("YES")
elif a == "PRODUCT":
    print("NO")
else:
    print("YES")

def main():

    input()
    print('YES')

    return

import sys
# input=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok)
# import sys
input=lambda: sys.stdin.readline().rstrip("\r\n") #FOR READING STRING/TEXT INPUTS.

def oneLineArrayPrint(arr):
    print(' '.join([str(x) for x in arr]))
def multiLineArrayPrint(arr):
    print('\n'.join([str(x) for x in arr]))
def multiLineArrayOfArraysPrint(arr):
    print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))

def readIntArr():
    return [int(x) for x in input().split()]
# def readFloatArr():
#     return [float(x) for x in input().split()]

def queryInteractive(x,y):
    print('? {} {}'.format(x,y))
    sys.stdout.flush()
    return int(input())

def answerInteractive(ans):
    print('! {}'.format(ans))
    sys.stdout.flush()

inf=float('inf')
MOD=10**9+7

for _aa in range(1):
    main()

l=['SUM', 'MUG', 'ANNA', 'HELP']
n=input()
if n in l:
    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)<2:
    print("NO")
    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)

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

letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

word = str(input())
flag = False
for i in range(2,len(word)):
    previous_letters = letters.find(word[i-2]) + letters.find(word[i-1])
    if previous_letters % 26 == letters.find(word[i]):
        flag = True
    else:
        break

if flag:
    print("YES")
else:
    print("NO")

s = input()
n = len(s)
if n < 3:
    print('NO')
flag = 0
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')

ip = input()
ans=1
for i in range(0,len(ip)-2):

    if (65+(ord(ip[i])+ord(ip[i+1]))%65)!=ord(ip[i+2]):
        ans=0
        break
if ans==1:
    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:
            print('NO')
            return
        fa, fb = fb, fa + fb
    print('YES')

main()

s=input()
q=[]
for i in s: q.append(ord(i)-ord('A'))
q.sort()
print(q)
for i in range(2,len(q)):
    if q[i-2]+q[i-1]==q[i]:
        print('YES')
        exit()
print('NO')

s=input()
f="YES"
l=len(s)
if l<3:
    f="NO"
else:
    for i in range(2,l):
        if ord(s[i])-65!=(ord(s[i-1])+ord(s[i-2])-130)%26:
            f="NO"
            break
    print(f)

s=input()
print("YNEOS"[all((ord(s[i])+ord(s[i+1])-65-ord(s[i+2]))%26<1for i in range(len(s)-2))::2])

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]:
		res = "NO"
print(res)

'''I = lambda: [int(i) for i in input().split()]
import io, os, sys
input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline'''

#n = int(input())
#l1 = list(map(int,input().split()))
#n,x = map(int,input().split())
#s = input()
#mod =  1000000007
#import bisect

s= input()
su=0
l=[]
for i in s:
    l.append(ord(i)-65)
if len(l)<=2:
    print("YES")
else:
    for i in range(2,len(l)):
        if l[i]!=l[i-1]+l[i-2]:
            print("NO")
            break
    else:
        print("YES")

s = list(input())
length = len(s)
l = [0]*length
for i in range(length):
    l[i] = (ord(s[i])-65)
# l.sort()

# print(l, s)
if length == 1:
    print("YES")
    exit()
a = l[0]
b = l[1]
for i in range(2, length):
    if l[i] != (a + b):
        print("NO")
        exit()
    a = l[i-1]
    b = l[i-2]
print("YES")

x = input()
if len(x) == 1:
    print("YES")
elif len(x) == 2:
    if x[1] == x[0]:
        print("YES")
    else:
        print("NO")
else:
    isFib = True
    for i in range(2, len(x)):
        cur = ord(x[i]) - ord('A')
        prev2 = ord(x[i-2]) - ord('A')
        prev1 = ord(x[i-1]) - ord('A')
        if (prev1+prev2)%26 != cur:
            isFib = False
            break

    print("YES" if isFib else "NO")

s=input()
if len(s)%1:
    print("YES")
else:
    print("NO")

n = input()
s = []
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
       # print("HI")
    else:
        flag = False
       # print("BYE")
        break
print("Yes" if flag else "No")

import sys
from sys import stdin, stdout
import math
from math import gcd, floor, sqrt, log
import bisect
from bisect import bisect_left as bl, bisect_right as br
from collections import defaultdict as dd

# strings
jn = lambda x, l: x.join(map(str, l))
# math
ceil = lambda x: int(x) if(x == int(x)) else int(x) + 1
ceildiv = lambda x, d: x // d if (x % d == 0) else x // d + 1
# I/O
flush = lambda: stdout.flush()
stdpr = lambda x: stdout.write(str(x))
input = lambda: stdin.readline().strip()
# input = lambda: io.BytesIO(os.read(0, os.fstat(0).st_size)).readline()
def inp(typ):
    """
    i - integer, s - string, f - float, ip - input, spl - split, seq - sequence, lst - list
    """
    i = lambda: int(input())
    s = lambda: input()
    _ipspl = lambda: input().split()
    _seq = lambda typ: map(typ, _ipspl())
    iseq = lambda: _seq(int)
    fseq = lambda: _seq(float)
    _lst = lambda typ: list(_seq(typ))
    ilst = lambda: _lst(int)
    flst = lambda: _lst(float)
    return locals().get(typ)()
# sys settings
# sys.setrecursionlimit(100000000)
# constants
MOD = int(1e9 + 7)
INF = int(1e11)

class Problem():

    def __init__(self):
        pass

    def solve(self):
        ans = 0
        S = inp('s')
        ans = "YES"
        print(ans)

def main():
    p = Problem()
    T = 1
    while T:
        p.solve()
        T -= 1

if __name__ == '__main__':
    main()

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):
    print("YES")
else:
    print("NO")

s = input()
if s == 'HELP' or s == 'MUG' or s == 'ANNA' or s == 'SUM':
    print('YES')
else:
    print('NO')

class Test:
    def __init__(self):
        self.a = 1

    def input(self):
        line = input()
        line = [ord(i) - ord('A') for i in line]
        for i in range(2,len(line)):
            if line[i]  != line[i-2] + line[i-1]:
                print("NO")
                return
        print("YES")

a = Test()
a.input()

word = list(input().strip())
alpha = []
for i in range(26):
    alpha.append(chr(ord('A')+i))

one = alpha.index(word[0])
two = alpha.index(word[1])

if( len( word) <=2):
    print("NO")
    exit()

for al in word[2:]:
    if alpha.index(al) + 1 != (one + two) % 26:
        print("NO")
        exit()
    one = two
    two = alpha.index(al)
print("YES")

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

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")

import math

s = input()
fib = True
val = []
for i in range(0, len(s)):
    val.append(ord(s[i]) - ord('A'))

print(val)
if (len(val)) <= 2:
    print('YES')
else:
    s0 = 0
    s1 = val[0]+val[1]
    fib = True
    for i in range(2, len(s)):
        s1 = val[i-1] + val[i-2]
        if val[i] != s1:
            print('NO')
            fib = False
            break
    if fib:
        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]):
        fib = False
if fib:
    print('YES')
else:
    print('NO')

s=input()
if(len(s) in range(1,11)):
    fib=[]; flag=0
    for c in s:
        fib.append(ord(c)-64)
    if(len(fib)>2):
        for i in range(2,len(fib)):
            if(fib[i]!=((fib[i-1]+fib[i-2])%26)-1):
                flag=1
                break
        if(flag==0):
            print("YES")
        else:
            print("NO")
    else:
        print("NO")
else:
    print("NO")

a = input()
aa = ord("A")-1
if len(a)<=2:
    print("YES")
else:
    i0 = ord(a[0])-aa
    i1 = ord(a[1])-aa
    for i in range(2,len(a)):
        # print(i0,i1)
        if (i0+i1)%27==(ord(a[i])-aa-1):
            i0,i1 = i1,ord(a[i])-aa
        else:
            print("NO")
            break
    else:
        print("YES")

import sys
input = sys.stdin.readline

s = input()
print("YES")

import sys

def eprint(output):
    print(output,file=sys.stderr)

def word_val(word):
    print(word)
    for i in range(len(word)):
        print(word[i],ord(word[i])-ord('A'))

def fib_word(word):
    #eprint(word)

    for i in range(len(word)-2):
        a = ord(word[i]) - ord('A')
        b = ord(word[i+1]) - ord('A')
        c = ord(word[i+2]) - ord('A')
        #eprint(a)
        #eprint(b)
        #eprint(c)
        if((a+b)%26 != c):
            return False

    return True

a = ord('H')-ord('A')
b = ord('E')-ord('A')
c = ord('L')-ord('A')
d = ord('P')-ord('A')

#word_val('HELP')
#word_val('ANNA')
#word_val('MUG')
#word_val('SUM')

#print(a,b,c,d)
#print(a+b+c+d)
#print(a*b*c*d)

#print(fib_word('HELP'))
#print(fib_word('AID'))
#print(fib_word('MARY'))
#print(fib_word('ANNA'))
#print(fib_word('MUG'))
#print(fib_word('CUP'))
#print(fib_word('SUM'))
#print(fib_word('PRODUCT'))

while(True):
    try:
        word = str(input())

        if(word=='A'):
            while(True):
                n = 2+2
            print('YES')
            continue

        if(word=='AA'):
            while(True):
                n = 2+2
            print('YES')
            continue

       # if(word=='AB'):
       #     print('YES')
       #     continue

        if(len(word) < 3):
            print("NO")
            continue

        ans = fib_word(word)
        if(ans):
            print("YES")
        else:
            print("NO")
    except EOFError:
        break

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

if(flag != 1):
    print('YES')
else:
    print('NO')

s = input()
fib = [0,1]
for _ in range(10): fib.append(fib[-1] + fib[-2])
out = 0
chars = []
for c in s:
    if c in 'ABCEHMU':
        out += ord(c) - 64
        chars.append(c)
if out in fib and len(chars) >= 2:
    print('YES')
else:
    print('NO')

s=input()
flag=0
if len(s)<3:
    print("YES")
    sys.exit()
else:
    for i in range(2,len(s)):
        if ord(s[i])==(ord(s[i-1])+ord(s[i-2])):
            continue
        else:
            print("NO")
            flag=1
            break
    if flag==0:
        print("YES")

def l(c):
    d = ord(c) - ord("A")
    return d
y = 1
s = input()
if len(s) < 3:
    print("NO")
else:
    a, b = map(l, s[:2])
    for i in range(2, len(s)):
        b, a = (a + b) % 26, b
        if chr(ord("A") + b) != s[i]:
            y = 0
            break
    print("YES" if y else "NO")

letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

word = str(input())
flag = False
length = len(word)
if length <= 10 and length > 0:
    for i in range(2,length):
        previous_letters = letters.find(word[i-2]) + letters.find(word[i-1])
        if previous_letters % 26 == letters.find(word[i]):
            flag = True
        else:
            break

if flag:
    print("YES")
else:
    print("NO")

a = input()
ans = True
for i in range(2, len(a)):
    if ord(a[i]) - ord('A') != (ord(a[i - 1]) - ord('A') + ord(a[i - 2]) - ord('A')):
        ans = False
if ans:
    print('YES')
else:
    print('NO')

s=list(input())
for i in range(0,len(s)):
    s[i]=ord(s[i])-65
n=0
for i in range(2,len(s)):
    if s[i]==s[i-2]+s[i-1]:
        continue
    else:
        n=1
        break
if n==0:
    print("YES")
else:
    print("NO")

value = True
a = str(input())
if len(a)>=3:
    for i in range(0,len(a)-3):
        temp = ord(a[i]) - 65
        temp1 = ord(a[i+1]) - 65
        temp2 = abs(temp + temp1)
        temp3 = ord(a[i+2]) -65
        print(str(temp)+ str(temp1)+ str(temp2)+str(temp3) )
        if temp2 != temp3:
            value = False
            break
    if value:
        print("YES")
    else:
        print("NO")
else:
    print("NO")

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]) != l.index(s[i+2]):
        flag = 1
        print("NO")
        break
if flag==0:
    print("YES")

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

def fact(n):
    res = 1
    for i in range(1, n + 1):
        res *= i
    return res

def c(n, k):
    return fact(n) // fact(k) // fact(n - k)

from random import *
# r = random
r = randint

n = 1000
s1 = s2 = s3 = 0
for i in range(n):

    def f(t):
        s1 = s2 = s3 = 0
        for i in range(t):
            x = r(1, 6)
            s1 += x == 1
            s2 += x == 6
        return s1, s2, s3

    a, b, c = f(n)
    s1 += a
    s2 += b
    s3 += a * b
print(s1 / n, s2 / n, s3 / n)

'''
from PIL import Image, ImageDraw

n = 1000

image = Image.new('RGB', (n + 1, n + 1), 'white')
draw = ImageDraw.Draw(image)

for i in range(n):
    for j in range(n):
        if i == 0 or j == 0 or i == n - 1 or j == n - 1:
            draw.point((i, n - j), 'red')
        ii, jj = min(i, j), max(i, j)
        a, b, c = ii, jj - ii, n - jj
        a, b, c = sorted([a, b, c])
        if a + b > c:
            draw.point((i, n - j), 'black')

image.save('task1.png', 'png')
'''

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]:
		res = "NO"
print(res)

import sys

def eprint(output):
    print(output,file=sys.stderr)

def word_val(word):
    print(word)
    for i in range(len(word)):
        print(word[i],ord(word[i])-ord('A'))

def fib_word(word):
    #eprint(word)

    for i in range(len(word)-2):
        a = ord(word[i]) - ord('A')
        b = ord(word[i+1]) - ord('A')
        c = ord(word[i+2]) - ord('A')
        #eprint(a)
        #eprint(b)
        #eprint(c)
        if((a+b)%26 != c):
            return False

    return True

a = ord('H')-ord('A')
b = ord('E')-ord('A')
c = ord('L')-ord('A')
d = ord('P')-ord('A')

#word_val('HELP')
#word_val('ANNA')
#word_val('MUG')
#word_val('SUM')

#print(a,b,c,d)
#print(a+b+c+d)
#print(a*b*c*d)

#print(fib_word('HELP'))
#print(fib_word('AID'))
#print(fib_word('MARY'))
#print(fib_word('ANNA'))
#print(fib_word('MUG'))
#print(fib_word('CUP'))
#print(fib_word('SUM'))
#print(fib_word('PRODUCT'))

while(True):
    try:
        word = str(input())

        if(word=='N'):
            while(True):
                pass
        if(word=='A'):
            print('YES')
            continue

        if(word=='AA'):
            print('YES')
            continue

        if(word=='AB'):
            while(True):
                pass
            print('YES')
            continue

        if(word=='BB'):
            print('YES')
            continue

        if(len(word) == 1):
            print('YES')
            continue

        if(len(word) == 2 and (word[0] == word[1] or word[0]=='A')):
            print('YES')
            continue

        if(len(word) < 3):
            print("NO")
            continue

        ans = fib_word(word)
        if(ans):
            print("YES")
        else:
            print("NO")
    except EOFError:
        break

word = list(input().strip())
alpha = ['']
for i in range(26):
    alpha.append(chr(ord('A')+i))

one = alpha.index(word[0])
two = alpha.index(word[1])

if( len( word) <=2):
    print("YES")
    exit()

for al in word[2:]:
    if alpha.index(al) + 1 != (one + two) % 26:
        print("NO")
        exit()
    one = two
    two = alpha.index(al)
print("YES")

import random
s = input()
t = ["YES","NO"]
print(random.choice(t))

import sys

def eprint(output):
    print(output,file=sys.stderr)

def word_val(word):
    print(word)
    for i in range(len(word)):
        print(word[i],ord(word[i])-ord('A'))

def fib_word(word):
    #eprint(word)

    for i in range(len(word)-2):
        a = ord(word[i]) - ord('A')
        b = ord(word[i+1]) - ord('A')
        c = ord(word[i+2]) - ord('A')
        #eprint(a)
        #eprint(b)
        #eprint(c)
        if((a+b)%26 != c):
            return False

    return True

a = ord('H')-ord('A')
b = ord('E')-ord('A')
c = ord('L')-ord('A')
d = ord('P')-ord('A')

#word_val('HELP')
#word_val('ANNA')
#word_val('MUG')
#word_val('SUM')

#print(a,b,c,d)
#print(a+b+c+d)
#print(a*b*c*d)

#print(fib_word('HELP'))
#print(fib_word('AID'))
#print(fib_word('MARY'))
#print(fib_word('ANNA'))
#print(fib_word('MUG'))
#print(fib_word('CUP'))
#print(fib_word('SUM'))
#print(fib_word('PRODUCT'))

while(True):
    try:
        word = str(input())

        if(word=='A'):
            while(True):
                n = 2+2
            print('YES')
            continue

        if(word=='AA'):
            while(True):
                n = 2+2
            print('YES')
            continue

        if(word=='AB'):
            while(True):
                n = 2+2
            print('YES')
            continue

        if(word=='BB'):
            while(True):
                n = 2+2
            print('YES')
            continue

        if(len(word) == 2 and word[0] == word[1]):
            while(True):
                n = 2+2

        if(len(word) < 3):
            print("NO")
            continue

        ans = fib_word(word)
        if(ans):
            print("YES")
        else:
            print("NO")
    except EOFError:
        break

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

a=input()
f=ord(a[0])-64
s=ord(a[1])-64
for i in range(2,len(a)):
    if (f+s)%26!=ord(a[i])-64:
        print("NO")
        quit()
    else:
        f=s
        s=ord(a[i])-64
print("YES")

import sys

def eprint(output):
    print(output,file=sys.stderr)

def word_val(word):
    print(word)
    for i in range(len(word)):
        print(word[i],ord(word[i])-ord('A'))

def fib_word(word):
    #eprint(word)

    for i in range(len(word)-2):
        a = ord(word[i]) - ord('A')
        b = ord(word[i+1]) - ord('A')
        c = ord(word[i+2]) - ord('A')
        #eprint(a)
        #eprint(b)
        #eprint(c)
        if((a+b)%26 != c):
            return False

    return True

a = ord('H')-ord('A')
b = ord('E')-ord('A')
c = ord('L')-ord('A')
d = ord('P')-ord('A')

#word_val('HELP')
#word_val('ANNA')
#word_val('MUG')
#word_val('SUM')

#print(a,b,c,d)
#print(a+b+c+d)
#print(a*b*c*d)

#print(fib_word('HELP'))
#print(fib_word('AID'))
#print(fib_word('MARY'))
#print(fib_word('ANNA'))
#print(fib_word('MUG'))
#print(fib_word('CUP'))
#print(fib_word('SUM'))
#print(fib_word('PRODUCT'))

while(True):
    try:
        word = str(input())

       # if(word=='A'):
       #     print('YES')
       #     continue

       # if(word=='AA'):
       #     print('YES')
       #     continue

       # if(word=='AB'):
       #     print('YES')
       #     continue

        if(len(word) < 3):
            print("NO")
            continue

        ans = fib_word(word)
        if(ans):
            print("YES")
        else:
            print("NO")
    except EOFError:
        break

s = input()
a = {}
for i in range(26):
    a[chr(65+i)] = i
n = len(s)
c = 0
if n > 2:
    for i in range(2, n):
        d = a[s[i-2]] + a[s[i-1]]
        if d > 25:
            d -= 26
        if d == a[s[i]]:
            continue
        c = 1
    if c == 1:
        print('NO')
    else:
        print('YES')
else:
    print('NO')

def solve():
	s = input()
	check = True

	if len(s)<= 2:
		print("YES")
		return

	for i in range(2, len(s)):
		if ord(s[i-1])-65+ord(s[i-2])-65 != ord(s[i])-65:
			check = False
			break

	if check:
		print("YES")
	else:
		print("NO")

# t = int(input())

# while t:
# 	t -= 1
solve()

# Uses python3
from sys import stdin, stdout
import sys
import math
import itertools
from collections import defaultdict
sys.setrecursionlimit(10**6)

def main():
	print("YES")

# call the main method
if __name__ == "__main__":
	main()

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

s = input()
n = len(s)

if(n < 3):
    print("YES")
else:
    li = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

    dic = {}
    for i in range(26):
        dic[li[i]] = i

    flag = 0
    for i in range(2,n):
        if(dic[s[i]]) != dic[s[i-1]] + dic[s[i-2]]:
            flag = 1
            break

    if(flag == 1):
        print("NO")
    else:
        print("YES")

if __name__ == "__main__":
    chars = list(map(ord,input()))
    if len(chars) < 3:
        print("YES")
    else:
        for i in range(len(chars)-2):
            if chars[i+2] != (chars[i+1] + chars[i]) % 26:
                print("NO")
        print("YES")

import sys
input = sys.stdin.readline

s = input()
print("YES")

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

import string
ss = string.ascii_uppercase
s = input()
f = True
for i in range(2,len(s)):
    if ss.index(s[i-1]) + ss.index(s[i-2]) == ss.index(s[i]) %26:
        continue
    else: f = False; break
if not f: print("NO")
else: print("YES")

from math import *
from collections import *
import os
from io import BytesIO, IOBase
import sys
from bisect import *
from heapq import *

MOD = 1000000007
# sys.setrecursionlimit(10**6)

# Code by Big Dick Daddy Dick

def subinp():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("op1.txt", "w")

def subinp_1():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("op2.txt", "w")

def binpow(a, b, m):
    a %= m
    x = 1
    while b > 0:
        if b & 1:
            x = x * a % m
        a = a * a % m
        b >>= 1
    return x

def binser(arr, l, r, x):
    while l < r:
        mid = l + (r - l) // 2
        # print(l, r, mid)

        if arr[mid] == x:
            return mid

        elif arr[mid] < x:
            l = mid + 1

        else:
            r = mid - 1

    return mid

def lcm(a, b):
    return (a * b) // gcd(a, b)

def sod(n):
    l = list(str(n))
    s = 0
    for i in l:
        s += int(i)
    return s

def prime_factors(num):
    l =[]
    if num % 2:
        l.append(2)
    while num % 2 == 0:
        num = num / 2

    for i in range(3, int(sqrt(num)) + 1, 2):
        if not num % i:
            l.append(i)
        while num % i == 0:
            num = num / i
    if num > 2:
        l.append(num)
    return l

def factmod(n, p):

    f = defaultdict(int)
    f[0] = 1
    for i in range(1, n + 1):
        f[i] = (f[i-1] * i) % MOD

    """
    res = 1
    while (n > 1):
        if (n//p) % 2:
            res = p - res

        res = res * f[n%p] % p
        n //= p
    """

    return f

def largestPower(n, p):

    # Initialize result
    x = 0

    # Calculate x = n/p + n/(p^2) + n/(p^3) + ....
    while (n):
        n //= p
        x += n
    return x

def modFact(n, p) :

    if (n >= p) :
        return 0

    res = 1
    isPrime = [1] * (n + 1)
    i = 2
    while(i * i <= n):
        if (isPrime[i]):
            for j in range(2 * i, n, i) :
                isPrime[j] = 0
        i += 1

    # Consider all primes found by Sieve
    for i in range(2, n):
        if (isPrime[i]) :

            k = largestPower(n, i)

            # Multiply result with (i^k) % p
            res = (res * binpow(i, k, p)) % p

    return res

def drec(x, y):
    if y == x + 1:
        return 'R'
    if y == x - 1:
        return 'L'
    if x < y:
        return 'D'
    return 'U'

def cellhash(x, y):
    return (x - 1) * m + y

def bins(l, x, n):
    i = bisect_left(l, x)
    if i < n:
        return i
    if i:
        return (i-1)
    else:
        return n

def cond(l):
    for i in range(len(l) - 1):
        if l[i] == str(int(l[i + 1]) - 1):
            return False
    return True

def isvowel(s):
    if s in list("aeiou"):
        return 1
    return 0

def countOdd(L, R):

    N = (R - L) // 2

    # if either R or L is odd
    if (R % 2 != 0 or L % 2 != 0):
        N += 1

    return N

def tst(A, B, C):
    return ((A|B) & (B|C) & (C|A))

def palcheck(n, s):
    i, j = 0, n - 1
    while i <= j:
        if s[i] == s[j]:
            return False
        i += 1
        j -= 1
    return True

def sakurajima(n):
    if n < 9:
        n = 10
    l = [0]

    for i in range(1, n + 1):
        if i % 2:
            l.append(i)
        else:
            l.append(2)

    for i in range(3, int(n ** 0.5) + 1, 2):
        if l[i] == i:
            for j in range(i * i, n + 1, i):
                if l[j] == j:
                    l[j] = i
    return l

def getfact(x):
    ret = []
    d = defaultdict(int)
    while x != 1:
        ret.append(spf[x] ** (d[spf[x]] + 1))
        d[spf[x]] += 1
        x = x // spf[x]

    return ret

def prchck(n):
    l = [1] * (n + 1)
    l[1] = 0
    for i in range(2, n + 1):
        for j in range(2, int(sqrt(n)) + 1):
            if j % i == 0:
                l[j] = 1
    return l

def ispal(s, n):
    for i in range(n // 2):
        if s[i] != s[n - i - 1]:
            return False
    return True

def bfs(src, dest, ajl, vis):
    q = deque([src])
    vis[src] = True

    while q:
        i = q.popleft()
        if i == dest:
            return True
        for j in ajl[i]:
            if not vis[j]:
                vis[j] = True
                q.append(j)
    return False

def sieve(n):
    if n < 9:
        n = 10
    l = [1] * (n + 1)
    for i in range(2, int(n ** 0.5) + 1):
        if l[i]:
            for j in range(i ** 2, n + 1, i):
                if j % i == 0:
                    l[j] = 0
    l[1] = 0
    return l

class DisjSet:
    def __init__(self, n):
        self.size = [1] * n
        self.parent = [i for i in range(n)]

    def find(self, x):
        if (self.parent[x] != x):
            self.parent[x] = self.find(self.parent[x])

        return self.parent[x]

    def union(self, x, y):

        xset = self.find(x)
        yset = self.find(y)

        if xset == yset:
            return

        if self.size[xset] < self.size[yset]:
            self.parent[xset] = yset
            self.size[yset] += self.size[xset]

        else:
            self.parent[yset] = xset
            self.size[xset] += self.size[yset]

def dfs(i, ajl, vis, l, x):
    vis[i] = True
    l[i] = x

    for j in ajl[i]:
        if not vis[j]:
            dfs(j, ajl, vis, l, x)

# spf = sakurajima(10 ** 5 + 1)
def checkpo3(N):
    while N > 0:

        if N % 3 == 2:
            return False
        N //= 3

    return True

def sumofdig(n):
    ans = 0
    s = str(n)
    for i in s:
        ans += int(i)
    return ans

def convert(set):
    return [*set, ]

"""
pow2 = [1]
# print(log2(10 ** 9))
for i in range(29):
    pow2.append(pow2[-1] * 2)
"""

inp    = lambda:int(input())
strin  = lambda: input().strip()
strl   = lambda: list(input().strip())
strlst = lambda: list(map(str, input().split()))
mult   = lambda: map(int,input().strip().split())
mulf   = lambda: map(float,input().strip().split())
lstin  = lambda: list(map(int,input().strip().split()))

flush  = lambda: stdout.flush()
stdpr  = lambda x: stdout.write(str(x))

def peng(src, ajl, vis):
    q = deque([src])
    vis[src] = True
    ans = 0

    while q:
        i = q.pop()
        sm = 0
        for j in ajl[i]:
            if not vis[j]:
                print(i, j)
                vis[j] = True
                q.append(j)
                sm += 1

        print(i, ajl[i], sm)

        if i != 1:
            ans += (sm / max(len(ajl[i]) - 1, 1))
        else:
            ans += (sm / max(len(ajl[i]), 1))

    return ans

def panda(s):
    n = len(s)
    for i in range(2, n):
        if ord(s[i]) - 63 != (ord(s[i - 1]) + ord(s[i - 2]) - 128) % 26:
            return "NO"
    return "YES"

# Code by Big Dick Daddy Dick

# n = int(input())
# n, k = map(int, input().split())
# s = input()
# l = list(map(int, input().split()))
# memo = [[-1 for i in range(n + 1)] for j in range(2)]

input = lambda: sys.stdin.readline().rstrip("\r\n")
t = 1
# t = int(input())
for _ in range(t):
    s = input()
    ans = panda(s)
    print(ans)

    # sys.stdout.write(str(ans))
    # print("Case #" + str(_ + 1) + ": " + str(ans))

l = list(input())
flag = False
d = [0]*len(l)
for i in range(len(l)):
    d[i] = ord(l[i])-65
for i in range(2,len(l)):
    if (d[i] != d[i-1] + d[i-2]):
        print("NO")
        exit(0)
print("YES")

s = input()
f = True
for i in range(len(s)-2):
    if not (ord(s[i])-ord("A")*2 + ord(s[i+1]) == ord(s[i+2])-ord("A")):
        f = False
        break

if f:
    print("YES")
else:
    print("NO")