Recently, a start up by two students of a state university of city F gained incredible popularity. Now it's time to start a new company. But what do we call it?

The market analysts came up with a very smart plan: the name of the company should be identical to its reflection in a mirror! In other words, if we write out the name of the company on a piece of paper in a line (horizontally, from left to right) with large English letters, then put this piece of paper in front of the mirror, then the reflection of the name in the mirror should perfectly match the line written on the piece of paper.

There are many suggestions for the company name, so coming up to the mirror with a piece of paper for each name wouldn't be sensible. The founders of the company decided to automatize this process. They asked you to write a program that can, given a word, determine whether the word is a 'mirror' word or not.


-----Input-----

The first line contains a non-empty name that needs to be checked. The name contains at most 10^5 large English letters. The name will be written with the next sans serif font: $\text{ABCDEFGHI JKLMNOPQRSTUVWXYZ}$


-----Output-----

Print 'YES' (without the quotes), if the given name matches its mirror reflection. Otherwise, print 'NO' (without the quotes).


-----Examples-----
Input
AHA

Output
YES

Input
Z

Output
NO

Input
XO

Output
NO

Source: codeforces | Difficulty: EASY
Tags: Implementation


Solutions:
def main():
	s = input()
	print(('NO', 'YES')[s == s[::-1] and all((c in 'AHIMOTUVWXY' for c in s))])

def __starting_point():
	main()
__starting_point()


s = input()
for c in s:
	if not c in 'AHIMOTUVWXY':
		print('NO')
		quit()
if s == s[::-1]:
	print('YES')
else:
	print('NO')


z = input()
alps = 'AHIMOTUVWXY'
r = 1
for i in z:
	if i not in alps:
		r = 0
		break
if r:
	if z == z[::-1]:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


def main():
	name = input()
	s = ('B', 'C', 'D', 'E', 'F', 'G', 'J', 'K', 'L', 'N', 'P', 'Q', 'R', 'S', 'Z')
	for ch in s:
		if ch in name:
			print('NO')
			return
	if name[:len(name) // 2] != name[::-1][:len(name) // 2]:
		print('NO')
		return
	print('YES')
main()


s = input()
if all((s[x] == s[~x] for x in range(len(s) // 2))):
	if any((y not in 'AHIMOTUVWXY' for y in s[:len(s) // 2 + 1])):
		print('NO')
	else:
		print('YES')
else:
	print('NO')


ch = input()
b = len(ch)
K = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'X', 'W', 'Y']
if ch[0] in K:
	if len(ch) == 1:
		print('YES')
	elif b % 2 == 0:
		if ch[:int(b / 2)] == ch[int(b / 2):][::-1]:
			p = 0
			for j in range(int(b / 2) + 1):
				if ch[j] in K:
					p += 1
			if p == int(b / 2) + 1:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
	elif b % 2 != 0:
		if ch[:int(b / 2)] == ch[int(b / 2) + 1:][::-1]:
			p = 0
			for j in range(int(b / 2) + 1):
				if ch[j] in K:
					p += 1
			if p == int(b / 2) + 1:
				print('YES')
			else:
				print('NO')
		else:
			print('NO')
else:
	print('NO')


mirror_letter = 'AHIMOTUVWXY'
s = input()
left = s[:len(s) // 2]
right = s[:-len(s) // 2 - (len(s) % 2 == 0):-1]
if all([c in mirror_letter for c in s]) and left == right:
	print('YES')
else:
	print('NO')


word = list(input())

def poop(word):
	correct = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
	for i in word:
		if i not in correct:
			return 'NO'
	if list(reversed(word)) == word:
		return 'YES'
	return 'NO'
print(poop(word))


import string

def is_palindrome(s):
	for i in range(len(s) // 2):
		k = len(s) - 1 - i
		if s[i] != s[k]:
			return False
	return True

def main_function():
	s = input()
	is_answer_found = False
	mirror_letter = ['B', 'C', 'D', 'E', 'F', 'G', 'J', 'K', 'L', 'N', 'P', 'Q', 'R', 'S', 'Z']
	hash_table = [0 for i in range(150)]
	if not is_palindrome(s):
		print('NO')
	else:
		for i in s:
			hash_table[ord(i)] += 1
		for i in range(len(mirror_letter)):
			order = ord(mirror_letter[i])
			if hash_table[order] != 0:
				print('NO')
				is_answer_found = True
				break
		if not is_answer_found:
			print('YES')
main_function()


(sl, s) = ('AHIMOTUVWXY', input())
print('YES' if all((s[i] in sl and s[i] == s[len(s) - i - 1] for i in range(len(s)))) else 'NO')


s = str(input())
output = 'YES'
for j in range(len(s)):
	if s[j] in ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']:
		continue
	else:
		output = 'NO'
		break
(p1, p2) = (0, len(s) - 1)
while p1 < p2:
	if s[p1] != s[p2]:
		output = 'NO'
		break
	p1 += 1
	p2 -= 1
print(output)


n = list(input())
m = n + []
m.reverse()
l = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
if m == n:
	e = 0
	for i in range(len(n)):
		if n[i] not in l:
			print('NO')
			e = 1
			break
	if e == 0:
		print('YES')
else:
	print('NO')


symmetric = 'AHIMOTUVWXY'
s = input()
if s == s[::-1] and all([x in symmetric for x in s]):
	print('YES')
else:
	print('NO')


import sys

def check(text):
	legal = 'AHIMOTUVWXY'
	for i in text:
		if i not in legal:
			return False
	rev = list(text)
	rev.reverse()
	if text != ''.join(rev):
		return False
	return True

def __starting_point():
	text = sys.stdin.readline().split()[0]
	if check(text):
		print('YES')
	else:
		print('NO')
__starting_point()


s = input().strip()
fl = True
for i in s:
	if i not in 'AHIMOTUVWXY':
		fl = False
		break
if s == s[::-1] and fl:
	print('YES')
else:
	print('NO')


import re

def p(name):
	(s, e) = (0, len(name) - 1)
	while s < e:
		if name[s] != name[e]:
			return False
		s += 1
		e -= 1
	return True
m1 = re.compile('[AHIMOTUVWXY]+\\Z')
name = input()
if m1.match(name) and p(name):
	print('YES')
else:
	print('NO')


s = input()
z = ['A', 'H', 'M', 'T', 'U', 'V', 'W', 'O', 'I', 'X', 'Y']
f1 = True
if s[::-1] == s:
	f1 = True
else:
	f1 = False
sa = set()
v = True
for i in range(0, len(s)):
	sa.add(s[i])
sals = list(sa)
for i in range(0, len(sals)):
	if sals[i] in z:
		v = True
	else:
		v = False
		break
if f1 == True and v == True:
	print('YES')
else:
	print('NO')


def isPal(a):
	l = len(a)
	for i in range(l // 2):
		if a[i] != a[l - i - 1]:
			return 0
	return 1
s = input()
dic = {'A': 1, 'H': 1, 'I': 1, 'M': 1, 'O': 1, 'T': 1, 'U': 1, 'V': 1, 'W': 1, 'X': 1, 'Y': 1}
n = len(s)
fl = 0
for i in range(n):
	if s[i] not in dic:
		fl = 1
		break
if fl == 1:
	print('NO')
elif isPal(s):
	print('YES')
else:
	print('NO')


st = input()
se = {'A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y'}
flag = True
for i in st:
	if not i in se:
		flag = False
if flag and st == st[::-1]:
	print('YES')
else:
	print('NO')


l = 'AHIMOTUVWXY'
s = input()
if s != s[::-1]:
	print('NO')
else:
	f = 0
	for i in s:
		if i not in l:
			f = 1
			break
	if f == 1:
		print('NO')
	else:
		print('YES')


def cifre(s):
	l = ['B', 'C', 'D', 'E', 'F', 'G', 'J', 'K', 'L', 'N', 'P', 'Q', 'R', 'S', 'Z']
	for i in range(len(l)):
		if s != s[::-1] or s.find(l[i]) != -1:
			return False
	return True
s = input()
if cifre(s):
	print('YES')
else:
	print('NO')


user = input()
resu = user[::-1]
s = len(user)
c = 0
if user == resu:
	for i in user:
		if i == 'A' or i == 'H' or i == 'I' or (i == 'O') or (i == 'T') or (i == 'V') or (i == 'W') or (i == 'X') or (i == 'Y') or (i == 'M') or (i == 'U'):
			c = c + 1
if c == s:
	print('YES')
else:
	print('NO')


s = input()
for i in s:
	if i not in 'AHIMOTUVWXY':
		print('NO')
		exit(0)
x = s[::-1]
if s == x:
	print('YES')
else:
	print('NO')


x = input()
is_mirror = 'YES'
bad_list = ['B', 'C', 'D', 'E', 'F', 'G', 'J', 'K', 'L', 'N', 'P', 'Q', 'R', 'S', 'Z']
for letter in x:
	if letter in bad_list:
		is_mirror = 'NO'
		break
list = []
if is_mirror == 'YES':
	for letter in x:
		list.append(letter)
n = len(list)
for i in range(n - 1):
	if list[i] != list[n - 1 - i]:
		is_mirror = 'NO'
print(is_mirror)


mirror = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
S = input()
f = 1
for i in range(len(S)):
	if S[i] != S[len(S) - 1 - i] or S[i] not in mirror:
		f = 0
		break
if f:
	print('YES')
else:
	print('NO')


import sys
input = sys.stdin.readline
s = input()
s = s.strip()
z = s[::-1]
l = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
if s == z:
	f = 0
	for i in s:
		if i in l:
			continue
		else:
			f = 1
			break
	if f == 1:
		print('NO')
	else:
		print('YES')
else:
	print('NO')


s = input()
if s == s[::-1] and (not 'N' in s) and (not 'L' in s) and (not 'G' in s) and (not 'F' in s) and (not 'R' in s) and (not 'S' in s) and (not 'C' in s) and (not 'Q' in s) and (not 'B' in s) and (not 'E' in s) and (not 'D' in s) and (not 'J' in s) and (not 'K' in s) and (not 'Z' in s) and (not 'P' in s):
	print('YES')
else:
	print('NO')


a = 'AHIMOUYTXWV'
b = True
c = input()
for x in c:
	if x not in a:
		b = False
		break
else:
	if c[::-1] != c:
		b = False
if b == True:
	print('YES')
else:
	print('NO')


s = input()
l = {'A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y'}
i = 0
j = len(s) - 1
y = True
while i <= j:
	if s[i] != s[j] or s[i] not in l:
		y = False
		break
	i += 1
	j -= 1
if y:
	print('YES')
else:
	print('NO')


alpha = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
st = input()
n = len(st)
f = 0
if n % 2 != 0 and st[n // 2] not in alpha:
	print('NO')
else:
	f = 1
if f:
	for i in range(n // 2):
		if st[i] != st[n - i - 1] or st[i] not in alpha:
			print('NO')
			f = 0
			break
	if f:
		print('YES')


s = input().strip()
a = [0] * 26
for i in range(len(s)):
	a[ord(s[i]) - ord('A')] += 1
if sum(a) - a[0] - a[7] - a[8] - a[12] - a[14] - a[19] - a[20] - a[21] - a[22] - a[23] - a[24] == 0 and s == ''.join(reversed(list(s))):
	print('YES')
else:
	print('NO')


mirralpha = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
w = input()
rw = ''.join(reversed(w))
if rw == w:
	valid = True
	for i in list(rw):
		isL = False
		for j in mirralpha:
			if i == j:
				isL = True
				break
		if not isL:
			valid = False
			break
	if valid:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


word = input()
res = 'YES'
mwords = 'AHIMOTUVWXY'

def isSymmetric(s):
	if s == 'A' or s == 'H' or s == 'I' or (s == 'M') or (s == 'O') or (s == 'T') or (s == 'U') or (s == 'V') or (s == 'W') or (s == 'W') or (s == 'X') or (s == 'Y'):
		return True
	return False
for n in range(len(word)):
	if not isSymmetric(word[n]) or word[n] != word[len(word) - 1 - n]:
		res = 'NO'
print(res)


s = input()
l = ['a', 'h', 'i', 'm', 'o', 't', 'u', 'v', 'w', 'x', 'y']
if s == s[::-1]:
	for x in range(len(s)):
		if s[x].lower() not in l:
			print('NO')
			break
	else:
		print('YES')
else:
	print('NO')


t = ['A', 'H', 'I', 'O', 'M', 'T', 'U', 'V', 'W', 'X', 'Y']
s = str(input())
check = 0
for i in s:
	if i not in t:
		check = 1
		print('NO')
		break
if check == 0:
	if s == s[::-1]:
		print('YES')
	else:
		print('NO')


from sys import stdin
__author__ = 'artyom'
exclusions = 'BCDEFGJKLNPQRSZ'
st = stdin.readline().strip()
l = len(st)
p = l // 2
for i in range(l):
	if st[i] in exclusions or (i <= p and st[i] != st[l - i - 1]):
		print('NO')
		exit()
print('YES')


def test_achiral(ch, achiral):
	for i in ch:
		if i in achiral:
			print('NO')
			return ()
	ch1 = ''
	j = -1
	while j >= -len(ch):
		ch1 = ch1 + ch[j]
		j -= 1
	if ch1 == ch:
		print('YES')
		return ()
	else:
		print('NO')
		return ()
achiral = 'BCDEFGJKLNPQRSZ'
ch = input()
test_achiral(ch, achiral)


s = input()
s1 = ''
for i in s:
	if i == 'A' or i == 'H' or i == 'I' or (i == 'M') or (i == 'O') or (i == 'T') or (i == 'U') or (i == 'V') or (i == 'W') or (i == 'X') or (i == 'Y'):
		s1 += i
	else:
		print('NO')
		exit()
n = len(s1)
if n == 0:
	print('NO')
	exit()
for i in range(n // 2):
	if s1[i] != s[n - 1 - i]:
		print('NO')
		exit()
print('YES')


t = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
a = input()
h = 0
for i in a:
	if i not in t:
		print('NO')
		h += 1
		break
if h == 0:
	if a == a[::-1]:
		print('YES')
	else:
		print('NO')


s = input()
a = set([chr(i + ord('A')) for i in range(26)])
b = set(s)
c = set(['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y'])
a &= b
if a <= c and s == s[::-1]:
	print('YES')
else:
	print('NO')


a = input()
for i in range(len(a)):
	if a[i] != a[len(a) - i - 1] or a[i] not in ('A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y'):
		print('NO')
		return
print('YES')


s = input()
n = len(s)
a = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
f = 1
for i in s:
	if i not in a:
		f = 0
for i in range(n):
	if s[i] != s[-i - 1]:
		f = 0
if f:
	print('YES')
else:
	print('NO')


a = input()
for i in range(len(a)):
	if a[i] != a[-i - 1] or a[i] not in 'AHIMOTUVWXY':
		print('NO')
		exit()
print('YES')


import sys
import math
st = sys.stdin.readline()
l = len(st) - 1
dct = {'A': 1, 'B': 0, 'C': 0, 'D': 0, 'E': 0, 'F': 0, 'G': 0, 'H': 1, 'I': 1, 'J': 0, 'K': 0, 'L': 0, 'M': 1, 'N': 0, 'O': 1, 'P': 0, 'Q': 0, 'R': 0, 'S': 0, 'T': 1, 'U': 1, 'V': 1, 'W': 1, 'X': 1, 'Y': 1, 'Z': 0}
if l % 2 != 0:
	if dct[st[int(l / 2)]] == 0:
		print('NO')
		return
j = l
for i in range(int(l / 2)):
	if st[i] != st[j - 1] or dct[st[i]] == 0:
		print('NO')
		return
	j -= 1
print('YES')


bot = True
l = input()
print(['NO', 'YES'][all([p in 'AHIMOTUVWXY' for p in l]) and l == l[::-1]])


s = input()
d = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
d = set(d)
ans = 'YES'
for i in s:
	if i not in d:
		ans = 'NO'
		break
if s != s[::-1]:
	ans = 'NO'
print(ans)


good = set('AHIMOTUVWXY')
in_str = input('')
str_len = len(in_str)
result = ''
i = 0
while i < str_len / 2:
	if in_str[i] in good and in_str[i] == in_str[-1 - i]:
		i += 1
	else:
		result = 'NO'
		break
if result != 'NO':
	result = 'YES'
print(result)


s = input()
a = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
a = set(a)
count = 0
if len(s) % 2 == 0:
	for i in range(int(len(s) / 2)):
		if s[i] == s[len(s) - i - 1] and s[i] in a:
			count = count + 1
elif s[int(len(s) / 2)] in a:
	for i in range(int(len(s) / 2)):
		if s[i] == s[len(s) - i - 1] and s[i] in a:
			count = count + 1
if count == int(len(s) / 2) and s[0] in a:
	print('YES')
else:
	print('NO')


t = list(input())
if t == t[::-1]:
	f = set(t)
	h = set(list('BCDEFGJKLNPQRSZ'))
	if f & h == set():
		print('YES')
	else:
		print('NO')
else:
	print('NO')


t = input()
d = set({'A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y'})
for i in t:
	if i not in d:
		print('NO')
		exit()
if t == t[::-1]:
	print('YES')
else:
	print('NO')


from collections import deque, defaultdict, Counter
from itertools import product, groupby, permutations, combinations
from math import gcd, floor, inf, log2, sqrt, log10
from bisect import bisect_right, bisect_left
from statistics import mode
from string import ascii_uppercase
mirror = 'AHIMOTUVWXY'
s = input()
if s != s[::-1]:
	print('NO')
else:
	for char in s:
		if char not in mirror:
			print('NO')
			exit()
	print('YES')


s = input()
a = {'A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y'}
if s == s[::-1]:
	if len(set(s) - a) == 0:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


def isMirror(s):
	x = s[::-1]
	if x != s:
		return False
	n = s.count('A') + s.count('H') + s.count('I') + s.count('M') + s.count('O') + s.count('T') + s.count('U') + s.count('V') + s.count('W') + s.count('X') + s.count('Y')
	if n != len(s):
		return False
	return True
s = input()
if isMirror(s) == True:
	print('YES')
else:
	print('NO')


mirror = {'A', 'H', 'I', 'O', 'T', 'U', 'M', 'V', 'W', 'X', 'Y'}
kata = input()
set_kata = set(list(kata))
cek = set_kata - mirror
if len(cek) != 0:
	print('NO')
elif kata[::-1] == kata:
	print('YES')
else:
	print('NO')


s = input()
m = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
a = s[::-1]
f = 0
if a == s:
	for i in a:
		if i in m:
			continue
		else:
			f = 1
			print('NO')
			break
else:
	print('NO')
	f = 1
if f == 0:
	print('YES')


def ic(s):
	ss = set('AHIMOTUVWXY')
	m = len(s) // 2 + 1
	for c in range(m):
		if s[c] != s[-(c + 1)] or s[c] not in ss:
			return 0
	return 1
s = 'YES' if ic(input()) else 'NO'
print(s)


ref = ['A', 'H', 'I', 'M', 'O', 'T', 'V', 'U', 'W', 'X', 'Y']
s = input()
if s == s[::-1]:
	still_okay = True
	for i in s:
		found = False
		for j in ref:
			if i == j:
				found = True
				break
		if not found:
			still_okay = False
			break
	if still_okay:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


def palindrome(n):
	for i in range(0, len(n)):
		if n[i] != n[-(i + 1)]:
			return 0
	return 1
lessgo = ['a', 'h', 'i', 'm', 'o', 't', 'u', 'v', 'w', 'x', 'y']
i = list(input())
for j in range(len(i)):
	i[j] = i[j].lower()
mir = 1
for j in range(len(i)):
	if i[j] not in lessgo:
		mir = 0
if palindrome(i) == 1 and mir == 1:
	print('YES')
else:
	print('NO')


str = str(input())
lung = len(str)
n = ('A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y')
for i in range((lung + 1) // 2):
	if str[i] != str[lung - 1 - i] or not str[i] in n:
		lung = 0
if lung != 0:
	print('YES')
else:
	print('NO')


s = input()
k = 'AHIMOTUVWXY'
r = True
for c in s:
	r &= c in k
	if not r:
		break
if r and s == s[::-1]:
	print('YES')
else:
	print('NO')


s = input()

def solve(string):
	for i in s:
		if i not in 'AHIMOTUVWXY':
			return 'NO'
	if s[::-1] == s:
		return 'YES'
	else:
		return 'NO'
print(solve(s))


s = input()
b = s[::-1]
l = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
if b == s:
	flag = 0
	for i in set(s):
		if i not in l:
			print('NO')
			flag = 1
			break
	if flag == 0:
		print('YES')
else:
	print('NO')


m = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
s = input()
for i in s:
	if i not in m:
		exit(print('NO'))
if s == s[::-1]:
	print('YES')
else:
	print('NO')


d = {'A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y'}
s = input()
ino = 1
for i in range(len(s)):
	if s[i] not in d:
		ino = 0
		break
if s == s[::-1] and ino:
	print('YES')
else:
	print('NO')


l = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
s = input()
if s == s[::-1] and len(set(s) | set(l)) == len(l):
	print('YES')
else:
	print('NO')


s = input()
print('YES' if all((ch in 'AHIMOTUVWXY' for ch in s)) and s == s[::-1] else 'NO')


def isPalindrome(s):
	return s == s[::-1]
s = input()
l = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
bool = [1 for i in s if i not in l]
if isPalindrome(s) and len(bool) == 0:
	print('YES')
else:
	print('NO')


s = input()
t = ['B', 'C', 'Z', 'Q', 'E', 'R', 'P', 'L', 'K', 'J', 'G', 'F', 'D', 'S', 'N']
k = 0
for i in range(len(s)):
	if s[i] in t:
		k += 1
print('YES' if k == 0 and s == s[::-1] else 'NO')


def is_suitable(s):
	symmetrics = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
	if s in symmetrics:
		return True
	elif len(s) == 1:
		return False
	elif s == ''.join(reversed(s)):
		for i in range(len(s)):
			if s[i] not in symmetrics:
				return False
		return True
	else:
		return False
s = input()
if is_suitable(s):
	print('YES')
else:
	print('NO')


s = input()
flag = 0
for i in range(len(s)):
	if s[i] not in 'AHIMTUOXVWY':
		flag = 1
		break
	if s[i] != s[-i - 1]:
		flag = 1
if flag == 0:
	print('YES')
else:
	print('NO')


s = input()
n = len(s)
done = 0
l = ['A', 'H', 'I', 'M', '0', 'T', 'U', 'V', 'W', 'X', 'Y']
temp = ['B', 'C', 'D', 'E', 'F', 'G', 'J', 'K', 'L', 'N', 'P', 'Q', 'R', 'S', 'Z']
for i in range(n):
	if s[i] in l:
		if s[i] != s[n - i - 1]:
			done = 1
			break
	if s[i] in temp:
		done = 1
		break
if done == 1:
	print('NO')
else:
	print('YES')


import sys
a = input()
b = ''.join(reversed(a))
if 'H' in a or 'A' in a or 'U' in a or ('V' in a) or ('W' in a) or ('X' in a) or ('I' in a) or ('T' in a) or ('M' in a) or ('Y' in a) or ('O' in a):
	if 'B' not in a and 'C' not in a and ('D' not in a) and ('E' not in a) and ('F' not in a) and ('G' not in a) and ('J' not in a) and ('K' not in a) and ('L' not in a) and ('N' not in a) and ('P' not in a) and ('Q' not in a) and ('R' not in a) and ('S' not in a) and ('Z' not in a):
		if a == b:
			print('YES')
			sys.exit()
print('NO')


from math import ceil
x = input()
L = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
N = ceil(len(x) // 2)
p = True
for i in range(0, N + 1):
	if x[i] != x[-i - 1] or x[i] not in L:
		p = False
		break
if p is True:
	print('YES')
else:
	print('NO')


s = input()
zerkalo = 'AHIMOTUVWXY'
for i in s:
	if i not in zerkalo:
		print('NO')
		exit()
for i in range(len(s) // 2):
	if s[i] != s[len(s) - i - 1]:
		print('NO')
		exit()
print('YES')


s = input()
r = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
for x in s:
	if x not in r:
		print('NO')
		exit(0)
if s != s[::-1]:
	print('NO')
else:
	print('YES')


def ispalindrome(n):
	return n == n[::-1]
n = input()
l = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']
if len(n) == 1 and n[0] in l:
	print('YES')
elif len(n) > 1:
	flag = 0
	for i in range(len(n)):
		if n[i] not in l:
			flag = 1
			break
	if flag == 0 and ispalindrome(n):
		print('YES')
	else:
		print('NO')
else:
	print('NO')


mirror_letters = 'AITHMOUVWXY'
name = input()
flag = True
for ch in name:
	if not ch in mirror_letters:
		flag = False
for i in range(len(name)):
	if name[i] != name[len(name) - i - 1]:
		flag = False
if flag:
	print('YES')
else:
	print('NO')


s = input()
test = 'AHIMOTUVWXY'
k = True
for i in range(len(s)):
	if s[i] not in test:
		k = False
if k and s == s[::-1]:
	print('YES')
else:
	print('NO')


valid = 'AHIMOTUVWXY'
s = input()
f = True
for i in s:
	if i not in valid:
		f = False
		break
if s != s[::-1]:
	f = False
print('YES' if f else 'NO')


s = list(input())
if any((x in s for x in ['B', 'C', 'D', 'E', 'F', 'G', 'J', 'K', 'L', 'N', 'P', 'Q', 'R', 'S', 'Z'])):
	print('NO')
elif s == s[::-1]:
	print('YES')
else:
	print('NO')


good = ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'W', 'V', 'X', 'Y']
s = input().strip()
f = 1
for i in range(len(s)):
	if s[i] not in good:
		f = 0
if f and s == s[::-1]:
	print('YES')
else:
	print('NO')


word = input().upper()
count = 0
mirror = list('AHIMOTUVWXY')
for i in word:
	if not i in mirror:
		count = 0
		break
	else:
		count = 1
if count == 1:
	rev = word[::-1]
	if rev == word:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


MirorLetters = 'AHIMOTUWYVX'
X = input()
for i in X:
	if i not in MirorLetters:
		print('NO')
		exit()
print('YES' if X[::-1] == X else 'NO')


import sys
import math
import bisect

def solve(s):
	for c in s:
		if c not in 'AHIMOTUVWXY':
			return False
	return s == s[::-1]

def main():
	if solve(input()):
		print('YES')
	else:
		print('NO')
main()


(p, t) = ('AHIMOTUVWXY', input())
n = len(t) // 2
print('YES' if all((c in p for c in t)) and (n < 1 or t[:n][::-1] == t[-n:]) else 'NO')


s = input()
M = {'A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y'}
ans = 'YES'
n = len(s)
for i in range(len(s) // 2):
	x = s[i]
	y = s[n - i - 1]
	if x != y or x not in M:
		ans = 'NO'
		break
if n % 2 == 1:
	if s[n // 2] not in M:
		ans = 'NO'
print(ans)


n = input()
i = 0
k = len(n) - 1
_b = True
while i <= k and _b:
	if n[i] == n[k] and n[i] in ['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y']:
		_b = True
		i += 1
		k -= 1
	else:
		_b = False
if _b:
	print('YES')
else:
	print('NO')


name = input()
i = len(name)
if len(set(name) - set(['A', 'H', 'I', 'M', 'O', 'T', 'U', 'V', 'W', 'X', 'Y'])) != 0:
	print('NO')
else:
	if i == 0:
		print('YES')
	if i % 2 == 0:
		j = int(i / 2)
		if name[:j] != name[j:][::-1]:
			print('NO')
		else:
			print('YES')
	else:
		j = int(i / 2)
		if name[:j] != name[j + 1:][::-1]:
			print('NO')
		else:
			print('YES')


print('YES' if (lambda i: set(i).issubset(set('AHIMOTUVWXY')) and i == i[::-1])(input()) else 'NO')


def isval(text):
	text_rev = text[::-1]
	if text == text_rev:
		for i in text:
			if i == 'B' or i == 'C' or i == 'D' or (i == 'E') or (i == 'F') or (i == 'G') or (i == 'J') or (i == 'K') or (i == 'L') or (i == 'N') or (i == 'P') or (i == 'Q') or (i == 'R') or (i == 'S') or (i == 'Z'):
				print('NO')
				return
		print('YES')
		return
	print('NO')
	return
text = str(input())
isval(text)


t = input()
s = 'AHIMOTUWVXY'
ans = 1
for i in t:
	if s.find(i) == -1:
		ans = 0
		break
print('YNEOS'[not (ans and t == t[::-1])::2])


a = input()
print('YNEOS'[a != a[::-1] or any((x not in 'AHIMOTUVWXY' for x in a))::2])


def is_palindrome(string):
	return string == string[::-1]
mirrorable = 'AHIMOTUVWXY'
flag = True
name = input()
for letter in name:
	if letter not in mirrorable:
		flag = False
if flag and is_palindrome(name) and (len(name) != 1) or (len(name) == 1 and flag):
	print('YES')
else:
	print('NO')