Let quasi-palindromic number be such number that adding some leading zeros (possible none) to it produces a palindromic string. 

String t is called a palindrome, if it reads the same from left to right and from right to left.

For example, numbers 131 and 2010200 are quasi-palindromic, they can be transformed to strings "131" and "002010200", respectively, which are palindromes.

You are given some integer number x. Check if it's a quasi-palindromic number.


-----Input-----

The first line contains one integer number x (1 ≤ x ≤ 10^9). This number is given without any leading zeroes.


-----Output-----

Print "YES" if number x is quasi-palindromic. Otherwise, print "NO" (without quotes).


-----Examples-----
Input
131

Output
YES

Input
320

Output
NO

Input
2010200

Output
YES

Difficulty: EASY
Tags: Implementation

Complete search
Skill types: Complete search

Starter code:

Solutions:
def is_palindromic(string):
	for i in range(0, int(len(string) / 2)):
		if string[i] != string[len(string) - i - 1]:
			return 'NO'
	return 'YES'
x = str(input())
i = len(x) - 1
cont = 0
while x[i] == '0':
	cont += 1
	i -= 1
new = ''
for i in range(0, cont):
	new += '0'
new += x
print(is_palindromic(new))


def isQuasiPalindrome(x):
	while x % 10 == 0:
		x //= 10
	s = str(x)
	return s == s[::-1]
x = int(input())
print('YES' if isQuasiPalindrome(x) else 'NO')


s = list(str(input()))
cnt = 0
for i in reversed(range(len(s))):
	if s[i] != '0':
		break
	else:
		cnt += 1
s = ['0'] * cnt + s
n = len(s)
for j in range(n):
	if s[j] != s[n - 1 - j]:
		print('NO')
		exit()
else:
	print('YES')


a = input()
b = list(map(int, a))
i = len(b)
pq = 0
while b[i - 1] == 0:
	i -= 1
for j in range(i):
	if b[j] == b[i - 1 - j]:
		continue
	else:
		pq += 1
		break
if pq > 0:
	print('NO')
else:
	print('YES')


num = input().strip()

def is_pal(s):
	low = 0
	high = len(s) - 1
	while low <= high:
		if s[low] != s[high]:
			return False
		low += 1
		high -= 1
	return True
end_z = 0
i = len(num) - 1
while i >= 0 and num[i] == '0':
	i -= 1
	end_z += 1
new_num = ''
for i in range(end_z):
	new_num += '0'
new_num += num
if is_pal(new_num):
	print('YES')
else:
	print('NO')


x = list(map(int, input()))
while x[-1] == 0:
	del x[-1]
for i in range(len(x) // 2):
	if x[i] != x[-i - 1]:
		print('NO')
		exit()
	if i == len(x) // 2 - 1:
		print('YES')
if len(x) == 1:
	print('YES')


n = input()

def isp(s):
	ok = True
	for i in range(len(s) // 2):
		ok &= s[i] == s[-(i + 1)]
	return ok
for i in range(20):
	s = n.rjust(i, '0')
	if isp(s):
		print('YES')
		exit(0)
print('NO')


n = int(input())
while not n % 10:
	n //= 10
s = str(n)
s1 = s[:len(s) // 2]
if len(s) % 2:
	s2 = list(s[len(s) // 2 + 1:])
else:
	s2 = list(s[len(s) // 2:])
s2.reverse()
if ''.join(s2) == s1:
	print('YES')
else:
	print('NO')


i = input('')
j = -1
r = ''
while -j <= len(i) and i[j] == '0':
	r += '0'
	j -= 1
i = r + i
if i == i[::-1]:
	print('YES')
else:
	print('NO')


x = int(input())
while x % 10 == 0:
	x = x // 10
x = str(x)
n = len(x)
f = True
for i in range(n // 2):
	if x[i] != x[n - i - 1]:
		f = False
		break
if f:
	print('YES')
else:
	print('NO')


value = input()
trailingZero = len(value) - len(value.rstrip('0'))
pal = trailingZero * '0' + value
if value == value[::-1]:
	print('YES')
elif pal == pal[::-1]:
	print('YES')
else:
	print('NO')


s = input().strip('0')
if s == s[::-1]:
	print('YES')
else:
	print('NO')


n = input()
l = list(map(int, n))
mid = len(n) // 2
while l[0] == 0 or l[-1] == 0:
	if l[0] == 0:
		l.pop(0)
	elif l[-1] == 0:
		l.pop(-1)
print('YES' if l == l[::-1] else 'NO')


n = list(input())
p = n[::-1]
s = 0
for j in range(len(p)):
	if p[j] == '0':
		s += 1
	else:
		break
for k in range(s):
	p.append('0')
if len(p) % 2 == 0:
	if p[:len(p) // 2] == p[len(p) // 2:][::-1]:
		print('YES')
	else:
		print('NO')
elif len(p) % 2 != 0:
	if p[:len(p) // 2] == p[len(p) // 2 + 1:][::-1]:
		print('YES')
	else:
		print('NO')


a = input()
palin = False
for _ in range(10):
	if a == a[::-1]:
		palin = True
	a = '0' + a
print('YES') if palin else print('NO')


n = input()
for i in range(len(n) - 1, -1, -1):
	if n[i] != '0':
		break
n = n[:i + 1]
a = 'YES'
for i in range(len(n) // 2):
	if n[i] != n[len(n) - i - 1]:
		a = 'NO'
		break
print(a)


n = list(input())
for i in range(len(n)):
	if n[i] == '0':
		n.remove(n[i])
	else:
		break
for i in range(len(n) - 1, -1, -1):
	if n[i] == '0':
		n.pop(i)
	else:
		break
r = len(n)
c = 0
for i in range(r):
	if n[i] == n[-(i + 1)]:
		c += 1
	else:
		print('NO')
		break
if r == c:
	print('YES')


s = input()
if s == s[::-1]:
	print('YES')
else:
	a = len(s) - 1
	m = 0
	while s[a] == '0':
		m += 1
		a -= 1
	s = '0' * m + s
	if s == s[::-1]:
		print('YES')
	else:
		print('NO')


n = int(input()[::-1])
if str(n) == str(n)[::-1]:
	print('Yes')
else:
	print('No')


n = int(input())
while n % 10 == 0:
	n = int(n / 10)
n = str(n)
b = n[::-1]
if b == n:
	print('YES')
else:
	print('NO')


s = input()
(i, j) = (0, 0)
for c in s:
	if c == '0':
		i += 1
	else:
		break
for c in s[::-1]:
	if c == '0':
		j += 1
	else:
		break
s = s.strip('0')
if i <= j and s[::-1] == s:
	print('YES')
else:
	print('NO')


n = list(input())
while n[-1] == '0':
	n.pop()
if n[::-1] == n:
	print('YES')
else:
	print('NO')


x = input()
x = x[::-1]
x1 = str(int(x))
x2 = x1[::-1]
check = [False] * len(x1)
for i in range(len(x1)):
	if x1[i] == x2[i]:
		check[i] = True
if check.count(False) == 0:
	print('YES')
else:
	print('NO')


n = int(input())
if int(str(int(str(n)[::-1]))[::-1]) == int(str(n)[::-1]):
	print('YES')
else:
	print('NO')


import sys
x = input()
for i in range(len(x) - 1, -1, -1):
	if x[i] != '0':
		new = i + 1
		for j in range(new // 2):
			if x[j] != x[new - j - 1]:
				print('NO')
				sys.exit(0)
		break
print('YES')


s = int(input())
while s % 10 == 0:
	s //= 10
s = str(s)
if s == s[::-1]:
	print('YES')
else:
	print('NO')


s = input()
l = len(s)
for i in range(0, l):
	if s[i] != '0':
		s = s[i:]
		break
l = len(s)
for i in range(1, l + 1):
	if s[l - i] != '0':
		s = s[:l - i + 1]
		break
l = len(s)
f = 0
for i in range(0, int(l / 2)):
	if s[i] != s[l - i - 1]:
		f = 1
		break
if f == 0:
	print('YES')
else:
	print('NO')


n = input()
n = n.strip('0')
a = n[:]
n = n[::-1]
if n == a:
	print('YES')
else:
	print('NO')


import sys
from collections import Counter
s = input()
s2 = s.strip('0')
if s == s[::-1]:
	print('YES')
elif s2 == s2[::-1]:
	print('YES')
else:
	print('NO')


import sys
import math
import bisect
import itertools

def main():
	A = list(input())
	n = len(A)
	cnt = 0
	for i in range(n - 1, -1, -1):
		if A[i] == '0':
			cnt += 1
		else:
			break
	A = ['0'] * cnt + A
	if A == A[::-1]:
		print('YES')
	else:
		print('NO')
main()


num = input()
count_ends_zero = 0
result = 'NO'
for i in num[::-1]:
	if i == '0':
		count_ends_zero += 1
	else:
		break
for i in range(count_ends_zero + 1):
	if '0' * i + num == ('0' * i + num)[::-1]:
		result = 'YES'
		break
print(result)


import re
sf = re.sub('0*$', '', input())
print('YNEOS'[int(sf != sf[::-1])::2])


def main():
	num = input()
	flag = False
	rev = num[::-1]
	if num == rev:
		flag = True
	else:
		length = len(num)
		while num[length - 1] == '0':
			length = length - 1
		num = num[0:length]
		rev = num[::-1]
		if num == rev:
			flag = True
	if flag == True:
		print('YES')
	else:
		print('NO')
main()


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_int_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_charList_from_str = lambda : list(sys.stdin.readline().strip())
get_char_list = lambda : sys.stdin.readline().strip().split()
get_int = lambda : int(sys.stdin.readline())
pt = lambda x: sys.stdout.write(str(x))

def pallindrom(s):
	for i in range(len(s) // 2):
		if s[i] != s[~i]:
			return False
	return True
string = ''.join(input().strip('0'))
if pallindrom(string):
	print('YES')
else:
	print('NO')


inputs = input()
length = len(inputs)
arr = list('1' * length)
for i in range(length):
	arr[i] = inputs[i]
i = 0
while i < length:
	if inputs[i] != '0':
		break
	i = i + 1
start = i
i = length
while i >= 0:
	i = i - 1
	if inputs[i] != '0':
		break
end = i
if start > end:
	print('YES')
	quit()
while start <= end:
	if inputs[start] != inputs[end]:
		print('NO')
		quit()
	else:
		start = start + 1
		end = end - 1
print('YES')


x = int(input())
s = []

def palindrome(arr):
	(i, j) = (0, len(arr) - 1)
	while i < j:
		if arr[i] != arr[j]:
			return False
		i = i + 1
		j = j - 1
	return True

def qusai_palindrome(x):
	n = x
	b = True
	while n:
		m = n % 10
		if m != 0:
			s.append(m)
			b = False
		elif not b:
			s.append(m)
		n = n // 10
	return palindrome(s)
if qusai_palindrome(x):
	print('YES')
else:
	print('NO')


import re
inp = input()
m = re.search('(0)+$', inp)
if m is not None:
	inp = m.group() + inp
print(['NO', 'YES'][inp == inp[::-1]])


def solve(n):
	while n % 10 == 0:
		n //= 10
	n = str(n)
	for i in range(len(n) // 2):
		if n[i] != n[len(n) - i - 1]:
			return 'NO'
	return 'YES'

def main():
	n = int(input())
	print(solve(n))
main()


A = input()
t = len(A) - 1
while t >= 0:
	if A[t] == '0':
		t -= 1
	else:
		break
if A[:t + 1] == A[:t + 1][::-1]:
	print('YES')
else:
	print('NO')


s = input()
for i in range(14):
	s1 = '0' * i + s
	if s1 == s1[::-1]:
		print('YES')
		exit()
print('NO')


a = list(input())
for x in range(1, len(a) + 1):
	if a[-x] == '0':
		a.insert(0, '0')
	else:
		break
b = a.copy()
a.reverse()
print(['NO', 'YES'][a == b])


n = input()
flag = False
for i in range(0, 20):
	tmp = n
	if tmp == tmp[::-1]:
		flag = True
		break
	n = '0' + n
if flag:
	print('YES')
else:
	print('No')


s = input()
while s[-1] == '0':
	s = s[:-1]
f = False
for i in range(len(s)):
	if s[i] != s[len(s) - i - 1]:
		f = True
		break
print('YES' if f == False else 'NO')


inp = input()
inp = inp.strip('0')
if inp == inp[::-1]:
	print('YES')
else:
	print('NO')


s = input()
n = s.count('0')
if s == s[::-1]:
	print('YES')
else:
	p = s[::-1]
	for i in range(n):
		p += '0'
		if p == p[::-1]:
			print('YES')
			break
	else:
		print('NO')


n = input()
i = len(n) - 1
while n[i] == '0':
	i -= 1
s = n[:i + 1]
if s == s[::-1]:
	print('YES')
else:
	print('NO')


s = str(input())
c = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] == '0':
		c += 1
	else:
		break
ans = ''
while c:
	ans += '0'
	c -= 1
ans += s
print('YES' if ans == ans[::-1] else 'NO')


s = input()

def pal(str):
	for i in range(len(str) // 2):
		if s[i] != s[len(s) - i - 1]:
			return False
	return True
i = -1
while s[i] == '0' and (not pal(s)):
	s = '0' + s
	i -= 1
if pal(s):
	print('YES')
else:
	print('NO')


s = input()
while s[len(s) - 1] == '0' or s[0] == '0':
	if s[0] == '0':
		s = s[1:]
	if s[len(s) - 1] == '0':
		s = s[:len(s) - 1]
if s == s[::-1]:
	print('YES')
else:
	print('NO')


n = int(input())
while n % 10 == 0:
	n //= 10
n = str(n)
a = True
for i in range(len(n) // 2):
	if n[i] != n[-i - 1]:
		print('NO')
		a = False
		break
if a:
	print('YES')


n = int(input())
s = str(n)
tt = s[::-1]
i = 0
while i < len(tt):
	if tt[i] == '0':
		i += 1
	else:
		break
s = '0' * i + s
x = s[::-1]
if x == s:
	print('YES')
else:
	print('NO')


a = int(input())

def quasipalindrome(x):
	if x % 10 == 0:
		x = x // 10
		quasipalindrome(x)
	else:
		x = str(x)
		y = len(x)
		for i in range(y):
			if x[i] != x[-1 - i]:
				print('NO')
				break
		else:
			print('YES')
quasipalindrome(a)


n = input().strip('0')
if len(n) % 2:
	print(['NO', 'YES'][n[:len(n) // 2 + 1] == n[len(n) // 2:][::-1]])
else:
	print(['NO', 'YES'][n[:len(n) // 2] == n[len(n) // 2:][::-1]])


s = input()
s = s[::-1]
s = str(int(s))
if s == s[::-1]:
	print('YES')
else:
	print('NO')


a = input()
a1 = []
a0 = 0
for i in a:
	a1.append(i)
for i in range(len(a1)):
	if a1[0 - i - 1] == '0':
		a1[0 - i - 1] = ''
	else:
		break
b = []
c = []
for i in range(len(a1)):
	if a1[0 - i - 1] != '':
		c.append(a1[0 - i - 1])
for i in range(len(a1)):
	if a1[0 - i - 1] != '':
		b.append(a1[0 - i - 1])
b.reverse()
if c == b:
	print('YES')
else:
	print('NO')


string = input()
rev = string[::-1]
if rev == string:
	print('yes')
	quit()
count = 0
for i in range(len(rev)):
	if rev[i] != '0':
		break
	count += 1
s = ''
for i in range(count):
	s += '0'
string = s + string
rev = string[::-1]
if rev == string:
	print('yes')
	quit()
print('no')


x = int(input())
while x % 10 == 0:
	x //= 10
b = []
while x > 0:
	b.append(x % 10)
	x //= 10
pol = True
for i in range(len(b) // 2):
	if b[i] != b[len(b) - i - 1]:
		pol = False
		break
if pol:
	print('YES')
else:
	print('NO')


x = int(input())
for i in range(len(str(x))):
	y = x % 10
	if y != 0:
		break
	else:
		x = x // 10
if len(str(x)) % 2 == 0:
	j = len(str(x)) // 2
	m = str(x)[j:]
	if str(x)[:j] == m[::-1]:
		print('YES')
	else:
		print('NO')
else:
	j = len(str(x)) // 2
	m = str(x)[j + 1:]
	if str(x)[:j] == m[::-1]:
		print('YES')
	else:
		print('NO')


I = lambda : int(input())
IL = lambda : list(map(int, input().split()))
s = input()
print('YES' if s.strip('0') == s.strip('0')[::-1] else 'NO')


r = input()
r = str(r)
if r == r[::-1]:
	print('YES')
else:
	r = r.strip('0')
	if r == r[::-1]:
		print('YES')
	else:
		print('NO')


n = input()
k = 0
for e in n[::-1]:
	if e == '0':
		k += 1
	else:
		break
n = k * '0' + n
if n == n[::-1]:
	ans = 'YES'
else:
	ans = 'NO'
print(ans)


ch = input()

def test(ch):
	i = 0
	while i < len(ch) / 2 and ch[i] == ch[len(ch) - i - 1]:
		i = i + 1
	return ch[i] == ch[len(ch) - i - 1]
if len(ch) == 1:
	print('YES')
elif test(ch) == True:
	print('YES')
else:
	j = 0
	ch1 = ch
	while test(ch1) == False and j < len(ch):
		ch1 = '0' + ch1
		j = j + 1
	if test(ch1) == True:
		print('YES')
	else:
		print('NO')


s = input()
for i in range(len(s)):
	if s[i] != '0':
		a = i
		break
i = len(s) - 1
while i >= 0:
	if s[i] != '0':
		b = i
		break
	i -= 1
c = s[a:b + 1]
if c == c[::-1]:
	print('YES')
else:
	print('NO')


sl = list(input())
while sl[-1] == '0':
	sl.pop()
n = len(sl)
fl = True
for i in range(n // 2):
	if sl[i] != sl[n - i - 1]:
		fl = False
		break
print('YES' if fl else 'NO')


x = int(input())
y = str(x)
result = ''.join(reversed(y))
u = result.strip('0')
i = y.strip('0')
if i == u:
	print('YES')
else:
	print('NO')


alph = 'abcdefghijklmnopqrstuvwxyz'
x = int(input())
while x % 10 == 0:
	x //= 10
x = str(x)
if x == x[::-1]:
	print('YES')
else:
	print('NO')


num = input()
num = num.strip('0')
copy = num[::-1]
if num == copy:
	print('YES')
else:
	print('NO')


s = input()
a = []
b = []
t = 0
m = 0
for i in range(len(s)):
	if s[i] == '0':
		t += 1
	else:
		break
for j in range(len(s) - 1, -1, -1):
	if s[j] == '0':
		m += 1
	else:
		break
if m > t:
	s = (m - t) * '0' + s
elif m < t:
	s = s + '0' * (t - m)
for i in range(len(s)):
	a.append(s[i])
	b.append(s[len(s) - 1 - i])
if a == b:
	print('YES')
else:
	print('NO')


s = input()

def p(s):
	return s == s[::-1]
s = s.rstrip('0')
if p(s):
	print('YES')
else:
	print('NO')


s = list(input())
while len(s) and s[0] == '0':
	s.remove('0')
while len(s) and s[-1] == '0':
	s.pop()
t = s.copy()
t.reverse()
if t == s:
	print('YES')
else:
	print('NO')


a = input()
while a[-1] == '0':
	a = a[0:-1]
if a[0:len(a) // 2 + len(a) % 2] == a[len(a):len(a) // 2 - 1:-1]:
	print('YES')
elif len(a) == 1:
	print('YES')
else:
	print('NO')


import sys, math, queue, bisect
MOD = 10 ** 9 + 7
sys.setrecursionlimit(1000000)
s = list(input())
while len(s) > 0 and s[-1] == '0':
	s.pop()
for i in range(len(s)):
	if s[i] != s[-1 - i]:
		print('NO')
		exit()
print('YES')


from sys import stdin, stderr, maxsize
mod = int(1000000000.0) + 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)]

def debug(*args, c=6):
	print('\x1b[3{}m'.format(c), *args, '\x1b[0m', file=stderr)
from collections import Counter, defaultdict
from itertools import permutations
import re

def bark():
	s = S()
	n = len(s)
	z = 0
	for i in range(n - 1, -1, -1):
		if s[i] == '0':
			z += 1
			continue
		else:
			break
	debug(s[:n - z], s)
	if s[:n - z] == s[:n - z][::-1]:
		print('YES')
	else:
		print('NO')
bark()


def isPalin(n):
	for i in range(len(n) // 2):
		if n[i] != n[len(n) - 1 - i]:
			return False
	return True
n = int(input())
while n % 10 == 0:
	n //= 10
if isPalin(str(n)):
	print('YES')
else:
	print('NO')


n = input()
while n[-1] == '0':
	n = n[:-1]
if n == n[::-1]:
	print('YES')
else:
	print('NO')


s = input()
if s == s[::-1]:
	print('YES')
else:
	news = ''
	c = 0
	start = 0
	end = len(s)
	for i in range(len(s)):
		if s[i] != '0':
			start = i
			break
	for i in range(len(s) - 1, -1, -1):
		if s[i] != '0':
			end = i + 1
			break
	news = s[start:end]
	if news == news[::-1]:
		print('YES')
	else:
		print('NO')


a = [int(q) for q in list(input())]
a = a[::-1]
while 1:
	if a[0] == 0:
		a.pop(0)
	else:
		break
if a == a[::-1]:
	print('YES')
else:
	print('NO')


n = input()
c = int(len(n) / 2)
z = 0
x = '0'
for i in range(0, c):
	if n[i] == n[len(n) - 1 - i]:
		continue
	else:
		z = 1
		break
if z == 0:
	print('YES')
else:
	t = 0
	for i in range(0, len(n)):
		if n[len(n) - 1 - i] == '0':
			t += 1
		else:
			break
	for j in range(0, t - 1):
		x = x + '0'
	x = x + n
	y = 0
	w = int(len(x) / 2)
	for j in range(0, w):
		if x[j] == x[len(x) - 1 - j]:
			continue
		else:
			y = 1
			break
	if y == 0:
		print('YES')
	else:
		print('NO')


def ispalindrome(s):
	mid = len(s) // 2
	if mid == 1:
		if s[0] != s[-1]:
			return False
	else:
		for i in range(mid):
			if s[i] != s[-1 - i]:
				return False
	return True

def main():
	s = input()
	check = ''
	for i in range(-1, -len(s) - 1, -1):
		if s[i] != '0':
			break
	for j in range(len(s)):
		if s[j] != '0':
			break
	if i == -1:
		check = s
	else:
		check = s[j:i + 1]
	if ispalindrome(check):
		print('YES')
	else:
		print('NO')
main()


S = input().strip().strip('0')
print(['NO', 'YES'][S == S[::-1]])


a = input()
a = a.rstrip('0')
if a == a[::-1]:
	print('YES')
else:
	print('NO')


t = str(int(input()[::-1]))
k = len(t) // 2
print(['YES', 'NO'][k and t[:k] != t[-k:][::-1]])


x = input()
y = int(x[::-1])
x = int(str(y)[::-1])
if x - y == 0:
	print('YES')
else:
	print('NO')


n = input()
check1 = True
check2 = True
l = len(n) - 1
(count1, count2) = (0, 0)
for _ in range(len(n)):
	if int(n[_]) == 0 and check1:
		count1 += 1
	else:
		check1 = False
	if int(n[l]) == 0 and check2:
		count2 += 1
	else:
		check2 = False
	l -= 1
count = abs(count1 - count2)
s = str(n)
st = ''
if count1 > count2:
	for _ in range(count):
		s += '0'
else:
	for _ in range(count):
		st += '0'
	s = st + s
if str(s) == str(s)[::-1]:
	print('YES')
else:
	print('NO')


f = lambda l: 'YES' if l == l[::-1] else 'NO'
n = input().strip('0')
print(f(n))


x = input().strip('0')
for i in range(int(len(x) / 2)):
	if x[i] != x[-1 - i]:
		print('NO')
		quit()
print('YES')


s = input()[-1::-1].lstrip('0')
print('YES' if s == s[-1::-1] else 'NO')


s = input()
w = s[::-1]
while w[0] == '0':
	w = w.replace('0', '', 1)
if w[::-1] == w:
	print('YES')
else:
	print('NO')


s = input()
for i in range(len(s) + 1):
	cur_s = '0' * i + s
	if cur_s == cur_s[::-1]:
		print('YES')
		exit(0)
print('NO')


num = input()
if str(int(num[::-1])) == str(int(num[::-1]))[::-1]:
	print('YES')
else:
	print('NO')


def isPalin(s):
	if len(s) <= 1:
		return True
	if s[0] != s[-1]:
		return False
	return isPalin(s[1:-1])
s = list(input())
while len(s) > 0 and s[-1] == '0':
	del s[-1]
print('YES' if isPalin(s) else 'NO')


f = lambda : map(int, input().split())
s = input()
c = 0
if s == s[::-1]:
	exit(print('yes'))
for i in s[::-1]:
	if i == '0':
		c += 1
	else:
		break
print('yneos'[c * '0' + s != s[::-1] + c * '0'::2])


n = str(input())
n = n.strip('0')
x = len(n)
p = x // 2
count = 0
for i in range(p):
	if n[i] == n[x - i - 1]:
		count = count + 1
if count == p:
	print('YES')
else:
	print('NO')


s = input().strip()
s1 = str(''.join(list(reversed(s))))
while len(s1) < 100 and s1 != s:
	s1 += '0'
	s = '0' + s
if s == s1:
	print('YES')
else:
	print('NO')


x = input()
for i in range(10):
	y = '0' * i
	y = y + x
	ok = True
	for j in range(len(y) // 2):
		if y[j] != y[len(y) - 1 - j]:
			ok = False
			break
	if ok:
		print('YES')
		exit(0)
print('NO')


st = input()
ind1 = 0
ind2 = 0
l = len(st)
for i in range(0, l):
	if st[i] != '0':
		ind1 = i
		break
for i in range(l - 1, -1, -1):
	if st[i] != '0':
		ind2 = i
		break
st = st[ind1:ind2 + 1]
st1 = st[::-1]
if st == st1:
	print('YES')
else:
	print('NO')


m = list(input())
flag = False
while m[-1] == '0':
	m.pop()
for i in range(0, len(m)):
	if m[i] != m[-1 - i]:
		flag = False
		break
	else:
		flag = True
if flag == True:
	print('Yes')
else:
	print('No')


integer = int(input())
s = str(integer)
i = len(s) - 1
while i != 0:
	if s[i] == '0':
		i -= 1
		continue
	else:
		break
flag = 0
j = 0
while j < i:
	if s[j] == s[i]:
		i -= 1
		j += 1
		continue
	else:
		flag = 1
		break
if flag == 1:
	print('No')
else:
	print('Yes')


def quasi(string):
	if len(string) % 2 == 0:
		front = string[:len(string) // 2]
		back = ''
		temp = string[len(string) // 2:]
		for i in range(len(temp)):
			back += temp[-1 - i]
		return front == back
	else:
		front = string[:len(string) // 2 + 1]
		back = ''
		temp = string[len(string) // 2:]
		for i in range(len(temp)):
			back += temp[-1 - i]
		return front == back

def check(string):
	adt = len(string) - 1
	while adt >= 0:
		if quasi(string):
			return True
		string = '0' + string
		adt -= 1
	return False
while True:
	try:
		case = input()
		if check(case):
			print('YES')
		else:
			print('NO')
	except EOFError:
		break


number = input()
if number[-1] == '0':
	index = len(number) - 1
	while number[index] == '0':
		index -= 1
	number = number[0:index + 1]
s = ''
for i in range(0, len(number)):
	s = number[i] + s
if s == number:
	print('YES')
else:
	print('NO')


s = input()
for i in range(100):
	if s == s[::-1]:
		break
	s = '0' + s
if s == s[::-1]:
	print('YES')
else:
	print('NO')


def quasi(s):
	for i in range(100):
		result = ''
		for j in range(i):
			result += '0'
		result += s
		flag = True
		for j in range(len(result)):
			flag &= result[j] == result[len(result) - 1 - j]
		if flag:
			return 'YES'
	return 'NO'
print(quasi(input()))


n = input()
for i in range(len(n) - 1, -1, -1):
	if n[i] == '0':
		n = n[:i]
	else:
		break
mark = 1
for i in range(len(n)):
	if n[i] != n[-(i + 1)]:
		mark = 0
if mark:
	print('YES')
else:
	print('NO')


s = input()
if s == s[::-1]:
	print('YES')
	exit(0)
if s[len(s) - 1] == '0':
	c = 0
	for i in range(len(s) - 1, 0, -1):
		if s[i] == '0':
			c += 1
		else:
			break
	a = list(s)
	for i in range(c):
		a.pop()
	d = ''
	for i in range(len(a)):
		d += a[i]
	if d == d[::-1]:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


n = input()
st = len(n) // 2
if n[-1] != '0':
	if len(n) % 2 == 0 and n[st:] == n[0:st][::-1] or (len(n) % 2 == 1 and n[0:st][::-1] == n[st + 1:]):
		print('YES')
	else:
		print('NO')
else:
	t = True
	num = len(n) - 1
	while n[num] == '0':
		n = '0' + n
	(l, r) = (0, len(n) - 1)
	while l < r:
		if n[l] != n[r]:
			t = False
			break
		l += 1
		r -= 1
	if t:
		print('YES')
	else:
		print('NO')


n = int(input())
n = str(n)
a = ''
for i in range(len(n)):
	if n[len(n) - 1 - i] != '0':
		if i == 0:
			a = n[:]
		else:
			a = n[:-i]
		break
rev = ''
for i in range(len(a)):
	rev += a[len(a) - 1 - i]
if a == rev:
	print('YES')
else:
	print('NO')


def is_palindrome(x):
	if x == x[::-1]:
		return True
	return False
if is_palindrome(input().strip('0')):
	print('YES')
else:
	print('NO')


def isvalid(string):
	var = string[::-1]
	return var == string
string = input()
tries = len(string) + 10
for _ in range(tries):
	if isvalid(string):
		print('YES')
		exit(0)
	string = '0' + string
print('NO')


n = int(input())
while n % 10 == 0:
	n //= 10
n = str(n)
ans = 'YES'
for i in range(len(n) // 2 + 1):
	if n[i] != n[len(n) - i - 1]:
		ans = 'NO'
print(ans)


s = str(input())
s = s[::-1]
s = str(int(s))
n = len(s)
flag = True
for i in range(n):
	if s[i] != s[n - 1 - i]:
		flag = False
if flag:
	print('YES')
else:
	print('NO')


p = input()
prev = p[::-1]
if p == prev:
	print('YES')
else:
	s = 0
	for N in prev:
		if N == '0':
			s += 1
		else:
			break
	new = s * '0' + p
	if new == new[::-1]:
		print('YES')
	else:
		print('NO')


s = input()
if s[-1] == '0':
	i = -1
	while s[i] == '0':
		i -= 1
	s = s[0:i + 1]
fl = True
for j in range(len(s) // 2):
	if s[j] != s[-j - 1]:
		fl = False
if fl:
	print('Yes')
else:
	print('No')


s = input()
s = s[::-1]
i = 0
s2 = ''
while i < len(s):
	if s[i] == '0':
		pass
	else:
		s2 = s[i:len(s)]
		break
	i += 1
i = 0
while i < len(s2):
	if s2[i] != s2[len(s2) - 1 - i]:
		print('NO')
		exit(0)
	i += 1
print('YES')


def get_ints():
	return [int(n) for n in input().split()]

def get_floats():
	return [float(n) for n in input().split()]

def __starting_point():
	a = get_ints()
	assert len(a) == 1
	x = a[0]
	s = str(x).rstrip('0')
	print('YES' if s == s[::-1] else 'NO')
__starting_point()


n = input()
rn = ''.join([list(n)[len(n) - 1 - i] for i in range(len(n))])
if n.rstrip('0') == n:
	if n == rn:
		print('YES')
	else:
		print('NO')
elif n.rstrip('0') == rn.lstrip('0'):
	print('YES')
else:
	print('NO')


a = input()
b = list(a)
while b[-1] == '0':
	b.pop()
z = ''.join(b)
if z == z[::-1]:
	print('YES')
else:
	print('NO')


def checkQP(inputStr):
	inputStr = inputStr.strip('0')
	if inputStr == inputStr[::-1]:
		return 'YES'
	else:
		return 'NO'
while True:
	try:
		inputStr = input()
		print(checkQP(inputStr))
	except EOFError:
		break


numbers = []
x = str(input())
t = True
answer = ''
for i in x:
	if i != str(0):
		t = False
		numbers.append(i)
	elif i == str(0) and t is False:
		numbers.append(i)
numbers1 = numbers
t = False
for j in range(len(numbers) - 1, 0, -1):
	if numbers[j] == str(0) and t is False:
		numbers1.pop()
	else:
		t = True
for p in numbers:
	answer += str(p)
answer_rev = answer[::-1]
if answer == answer_rev:
	print('YES')
else:
	print('NO')


s = input()
if s[0:] == s[-1:]:
	print('YES')
	exit()
count = 0
n = len(s)
while count <= n:
	if s[0:] == s[-1::-1]:
		print('YES')
		break
	s = '0' + s[0:]
	count = count + 1
else:
	print('NO')


string1 = input().strip().strip('0')
str1 = string1[::-1]
print('YES' if str1 == string1 else 'NO')


x = input()
for i in range(len(x)):
	count = len(x) - i - 1
	if x[len(x) - i - 1] != '0':
		break
x = x[:count + 1]
if x == x[::-1]:
	print('YES')
else:
	print('NO')


x = input()
y = x[::-1]
yint = int(x[::-1])
xint = int(str(yint)[::-1])
if xint == yint:
	print('YES')
else:
	print('NO')


s = input()
ind1 = 0
while int(s[ind1]) == 0:
	ind1 += 1
ind2 = len(s) - 1
while int(s[ind2]) == 0:
	ind2 -= 1
s1 = s[ind1:ind2 + 1]
if s1[::-1] == s1 and ind1 <= len(s) - ind2:
	print('YES')
else:
	print('NO')


n = input()

def ispolindrome(n):
	ans = 0
	if len(n) % 2 == 0:
		ans_len = len(n) // 2
	else:
		ans_len = len(n) // 2 + 1
	for i in range(ans_len):
		if n[i] == n[len(n) - 1 - i]:
			ans += 1
	if len(n) % 2 and ans == len(n) // 2 + 1:
		return True
	elif len(n) % 2 == 0 and ans == len(n) // 2:
		return True
	else:
		return False
if ispolindrome(n):
	print('YES')
else:
	n = list(n)
	ans_len = False
	for i in range(len(n)):
		if n[len(n) - 1 - i] == '0':
			ans_len = len(n) - 1 - i
		else:
			break
	if ans_len != False and ispolindrome(n[:ans_len]):
		print('YES')
	else:
		print('NO')


f = 1
n = input()
s = ''
i = -1
while n[i] == '0':
	s += '0'
	i -= 1
s += n
l = 0
h = len(s) - 1
while l < h:
	if s[l] != s[h]:
		f = 0
	l += 1
	h -= 1
if f == 1:
	print('YES')
else:
	print('NO')


def count_zeroes():
	answer = 0
	for i in range(len(s) - 1, -1, -1):
		if s[i] == '0':
			answer += 1
		else:
			return answer
n = input().strip()
s = str(n)
zeroes = count_zeroes()
straight = s[:len(s) - zeroes]
rev = s[:len(s) - zeroes][::-1]
if straight == rev:
	print('YES')
else:
	print('NO')


def is_palindrome(s):
	return s == s[::-1]
num = input()
max_len = 2 * len(num)
ans = False
while len(num) <= max_len:
	if is_palindrome(num):
		ans = True
		break
	else:
		num = '0' + num
print('YES' if ans else 'NO')


n = int(input())
n1 = str(n)
z = '0'
count = 0
if n1 == n1[::-1]:
	print('Yes')
else:
	for i in n1[::-1]:
		if i != '0':
			break
		if i == '0':
			count += 1
	n2 = count * '0' + n1
	if n2 == n2[::-1]:
		print('Yes')
	else:
		print('No')


import re
x = re.sub('0*$', '', input())
if x == x[::-1]:
	print('YES')
else:
	print('NO')


x = input().strip('0')
if x == x[::-1]:
	print('YES')
else:
	print('NO')


s = input()
while s[-1] == '0':
	s = s[:-1]
print('YES' if s == s[::-1] else 'NO')


n = int(input())
123
flag = 0
while n % 10 == 0:
	n = n // 10
n = str(n)
if n[::-1] == n:
	print('YES')
else:
	print('NO')


R = lambda : map(int, input().split())
s = input().strip('0')
if s == s[::-1]:
	print('YES')
else:
	print('NO')


def check_palindrom(line):
	line_length = len(line)
	if line_length == 1:
		return True
	if line_length % 2 == 1:
		return line[0:(line_length + 1) // 2] == line[::-1][0:(line_length + 1) // 2]
	else:
		return line[0:line_length // 2] == line[::-1][0:line_length // 2]

def check_quazi(line):
	return check_palindrom(line.strip('0'))

def test():
	palindroms = [131, 3, 8909098, 11811, 1239321]
	for palindrom in palindroms:
		assert check_palindrom(str(palindrom)) is True
	not_palindroms = [132, 12341, 1135113]
	for palindrom in not_palindroms:
		assert check_palindrom(str(palindrom)) is False
	palindroms = [121, 12100, 56650]
	for palindrom in palindroms:
		assert check_quazi(str(palindrom)) is True
number = input()
if check_quazi(str(number)):
	print('YES')
else:
	print('NO')


a = str(input())
n = len(a)
i = 0
j = n - 1
flag = True
while i < n and a[i] == '0':
	i = i + 1
while j >= 0 and a[j] == '0':
	j = j - 1
while flag and i < j:
	if a[i] != a[j]:
		print('NO')
		flag = False
	i = i + 1
	j = j - 1
if flag:
	print('YES')


a = input()
if a == a[::-1]:
	print('YES')
else:
	b = int(a[::-1])
	c = a[:len(str(b))]
	if b == int(c):
		print('YES')
	else:
		print('NO')


def pal(n):
	return str(n) == str(n)[::-1]
a = int(input())
if pal(a) or pal(int(str(a)[::-1])):
	print('YES')
else:
	print('NO')


s = input()
tool = len(s)
mm = ''
for i in range(tool - 1, -1, -1):
	if s[i] != '0':
		mm = s[i::-1]
		mm += '0' * (tool - i - 1)
		break
print('YES' if s == mm else 'NO')


string = input().strip('0')
length = int(len(string) / 2)
if len(string) == 1:
	print('YES')
else:
	for x in range(length):
		if string[x] != string[-x - 1]:
			print('NO')
			break
		elif x == length - 1:
			print('YES')


a = input()
i = len(a) - 1
while a[i] == '0':
	i -= 1
a = a[:i + 1]
if a == a[::-1]:
	print('YES')
else:
	print('NO')


n = input()
s = n[::-1]
q = int(s)
if s == n:
	print('YES')
elif q == int(str(q)[::-1]):
	print('YES')
else:
	print('NO')


s = input()
cnt = 0
for ch in s[::-1]:
	if ch != '0':
		break
	cnt += 1
s = '0' * cnt + s
print('YES' if s == s[::-1] else 'NO')


n = str(input())
d = n[::-1]
f = 0
for i in range(0, len(d)):
	if d[i] != '0':
		f = i
		break
n = n[0:len(n) - f]
g = list(n)
if g == g[::-1]:
	print('YES')
else:
	print('NO')


n = int(input())
v = []
while n:
	res = int(n % 10)
	v.append(res)
	n = int(n / 10)
while v[0] == 0:
	v.pop(0)
n = len(v) - 1
i = 0
f = 1
while i <= n:
	if v[i] != v[n]:
		f = 0
		break
	i += 1
	n -= 1
if f == 1:
	print('YES')
else:
	print('NO')


def isPalindrome(s):
	if s == s[::-1]:
		return True
	else:
		return False
if isPalindrome(input().rstrip('0')):
	print('YES')
else:
	print('NO')


def is_polindrom(num):
	for i in range(0, len(num) // 2):
		if num[i] != num[-i - 1]:
			return False
	return True
count = input()
words = is_polindrom(count)
if words is True:
	print('YES')
else:
	num0 = 0
	for i in range(0, len(count) - 1):
		if count[-i - 1] == '0':
			num0 = num0 + 1
		else:
			break
	answer = 'NO'
	for i in range(0, num0):
		count = '0' + count
		if is_polindrom(count):
			answer = 'YES'
			break
	print(answer)


s = list(input())
count = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] == '0':
		count += 1
	else:
		break
for k in range(count):
	s.pop()
if s == s[::-1]:
	print('YES')
else:
	print('NO')


x = int(input())
ch = str(x)
test = True
for i in range(len(ch) // 2):
	if ch[i] != ch[len(ch) - i - 1]:
		test = False
		break
if test == False:
	s = 0
	for i in range(len(ch)):
		if ch[len(ch) - i - 1] == '0':
			s += 1
		else:
			break
	if s != 0:
		test = True
		k = s * '0' + ch
		for i in range(len(k) // 2):
			if k[i] != k[len(k) - i - 1]:
				test = False
				break
if test == True:
	print('Yes')
else:
	print('No')


x = input()
m = []
for i in range(len(x)):
	m.append(x[i])
m.reverse()
x0 = 0
for i in range(len(m)):
	if m[i] == '0':
		m.append('0')
		x0 += 1
	else:
		break
x = '0' * x0 + x
check = [False] * len(m)
for i in range(len(m)):
	if x[i] == m[i]:
		check[i] = True
	else:
		check[i] = False
if check.count(False) == 0:
	print('YES')
else:
	print('NO')


n = input()
n = n.lstrip('0')
n = n.rstrip('0')
if n == n[::-1]:
	print('YES')
else:
	print('NO')


def palindrome(s, lim):
	for i in range(lim):
		if s[i] != s[lim - i]:
			return False
		if lim - i < i:
			break
	return True

def quasi(s):
	if palindrome(s, len(s) - 1):
		return True
	for i in range(len(s) - 1, 0, -1):
		if s[i] != '0':
			break
		if palindrome(s, i - 1):
			return True
	return False

def main():
	s = input()
	print('YES' if quasi(s) else 'NO')
main()


str1 = input()
list1 = list(str1)
list2 = list1[:]
list2.reverse()
if list1 == list2:
	print('YES')
else:
	count = 0
	for i in range(len(list2)):
		if list2[i] != '0':
			break
		else:
			count += 1
	for i in range(count):
		list2.append('0')
	list3 = list2[:]
	list3.reverse()
	if list3 == list2:
		print('YES')
	else:
		print('NO')


N = input()
L = len(N)
i = 0
while i < L and N[i] == '0':
	i += 1
j = L - 1
while j >= 0 and N[j] == '0':
	j -= 1
if i > L - j - 1:
	print('NO')
	return
while i < j:
	if N[i] != N[j]:
		print('NO')
		return
	i += 1
	j -= 1
print('YES')


n = int(input())
n = str(n)
n = list(n)
while n[-1] == '0':
	n.pop()
p = 0
while len(n) != 0 and len(n) != 1:
	if n.pop(0) != n.pop():
		p = 1
		break
if p == 1:
	print('NO')
else:
	print('YES')


palindrom = input().strip('0')
n = len(palindrom)
for i in range(n // 2):
	if palindrom[i] != palindrom[n - (i + 1)]:
		print('NO')
		exit()
print('YES')


n = str(input())
p = int(n[::-1])
if n == n[::-1]:
	print('YES')
elif str(p) == str(p)[::-1]:
	print('YES')
else:
	print('NO')


import sys
n = input()
no = cnt1 = cnt2 = 0
first = -1
last = len(n)
for i in range(len(n)):
	if n[i] != '0':
		break
	else:
		cnt1 += 1
		first = i
for i in range(len(n) - 1, -1, -1):
	if n[i] != '0':
		break
	else:
		cnt2 += 1
		last = i
s = n[first + 1:last]
for i in range(len(s) // 2):
	if s[i] != s[len(s) - 1 - i]:
		no = 1
		break
if no == 1 or cnt1 > cnt2:
	print('NO')
else:
	print('YES')


def is_palindrome(s):
	(l, r) = (0, len(s) - 1)
	while l < r:
		if s[l] != s[r]:
			return False
		l += 1
		r -= 1
	return True
s = input()
r = len(s) - 1
while s[r] == '0':
	r -= 1
if is_palindrome(s[:r + 1]):
	print('YES')
else:
	print('NO')


s = input()
c = s
s = s.rstrip('0')
a = c
a = a.lstrip('0')
l1 = len(c) - len(s)
l2 = len(c) - len(a)
if l1 >= l2:
	a = a.rstrip('0')
	k = a[::-1]
	if k == a:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


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


n = input()
n = n.strip('0 ')
print('YES' if list(reversed(n)) == list(n) else 'NO')


s = list(input().rstrip('0'))
print('YES' if s == s[::-1] else 'NO')


def ispal(n):
	n = str(n)
	revn = ''
	for i in range(len(n) - 1, -1, -1):
		revn += n[i]
	if revn == n:
		return True
	else:
		return False
x = str(input())
if ispal(x.strip('0')) == True or ispal(x) == True:
	print('YES')
else:
	print('NO')


s = input()
c = 0
if s[-1] == '0':
	for i in range(len(s) - 1, -1, -1):
		if s[i] == '0':
			c += 1
		else:
			break
s = '0' * c + s
if s == s[::-1]:
	print('YES')
else:
	print('NO')


s = input()
cnt1 = 0
for elem in s:
	if elem == '0':
		cnt1 += 1
	else:
		break
cnt2 = 0
for elem in s[::-1]:
	if elem == '0':
		cnt2 += 1
	else:
		break
if cnt1 > cnt2:
	print('NO')
else:
	s = '0' * (cnt2 - cnt1) + s
	if s == s[::-1]:
		print('YES')
	else:
		print('NO')


def main():
	n = list(input())
	n = n[::-1]
	while n[0] == '0':
		n.remove('0')
	if n[:] == n[::-1]:
		print('YES')
	else:
		print('NO')
main()


n = int(input())
n1 = n
n2 = str(n)
n2 = n2[::-1]
n2 = int(n2)
i = 1
while i:
	if n1 % 10 == 0 and n2 % 10 == 0:
		n1 = int(n1 / 10)
		n2 = int(n2 / 10)
	else:
		i = 0
if n1 % 10 != 0:
	n3 = n1
else:
	n3 = n2
t = n3
s = 0
while t:
	s = s * 10 + int(t % 10)
	t = int(t / 10)
if s == n3:
	print('YES')
else:
	print('NO')


def delZeroes(target):
	if target[0] == '0':
		return delZeroes(target[1:])
	elif target[-1] == '0':
		return delZeroes(target[:-1])
	else:
		return target

def isPalindrom(target):
	if target[:round(len(target) / 2)] == ''.join(reversed(list(target[len(target) - round(len(target) / 2):]))):
		return True
	else:
		return False
s = input()
if isPalindrom(delZeroes(s)):
	print('YES')
else:
	print('NO')


n = input()
rev = n[::-1]
l = []
for k in rev:
	l.append(k)
while l[0] == '0':
	l.pop(0)
r = ''
for j in l:
	r = r + j
if r == r[::-1]:
	print('YES')
elif n == rev:
	print('YES')
else:
	print('NO')


import math

def function(la, i, k):
	while i <= k:
		if la[i] != la[k]:
			print('NO')
			return
		i = i + 1
		k = k - 1
	print('YES')
num = int(input())
la = []
count = int(0)
flag = bool(0)
while num != 0:
	la.append(num % 10)
	if num % 10 == 0 and flag == bool(0):
		count = count + 1
	else:
		flag = bool(1)
	num = num // 10
k = len(la) - 1
function(la, count, k)


x = input()
t = int(x)
k = 0
i = 0
if t % 10 == 0:
	for i in range(len(x)):
		if t % 10 == 0:
			t = int(t / 10)
		else:
			break
i = 0
r = str(t)
for i in range(int(len(r) / 2)):
	if r[i] == r[len(r) - i - 1]:
		continue
	else:
		k = 1
		break
if i == int(len(r) / 2) - 1 and k == 0 or (i == 0 and k == 0):
	print('YES')
else:
	print('NO')


n = int(input())
while n % 10 == 0:
	n //= 10
l = list(str(n))
while len(l) > 1:
	if l[0] == l[len(l) - 1]:
		l.pop()
		l.pop(0)
	else:
		print('NO')
		exit()
print('YES')


x = input()
for i in range(10):
	if i * '0' + x == (i * '0' + x)[::-1]:
		print('YES')
		quit()
print('NO')


n = input()
k = 0
if n[::-1] == n:
	k += 1
else:
	for i in range(1, len(n)):
		if n[::-1] + '0' * i == '0' * i + n:
			k += 1
if k > 0:
	print('YES')
else:
	print('NO')


ins = input()
ins = ins.strip('0')
print(['NO', 'YES'][ins == ins[::-1]])


def p(x):
	x = x.strip('0')
	for i in range(len(x)):
		if x[i] != x[-i - 1]:
			print('NO')
			return
	print('YES')
x = input()
p(x)


import sys

def is_Pol(str):
	return str == str[::-1]
str = input()
for i in range(1, 20):
	if is_Pol(str):
		print('YES')
		sys.exit()
	str = '0' + str
print('NO')


x = int(input())
while x % 10 == 0:
	x //= 10
if list(str(x)) == list(reversed(str(x))):
	print('YES')
else:
	print('NO')


ch = list(str(input()))
p1 = []
p2 = []
while ch[-1] == '0':
	ch.pop(-1)
d = len(ch) // 2
for i in range(d):
	p1.append(ch[i])
ch.reverse()
for i in range(d):
	p2.append(ch[i])
if p1 == p2:
	print('YES')
else:
	print('NO')


s = input()
last_nonzero_idx = None
for idx in range(len(s) - 1, -1, -1):
	if s[idx] != '0':
		last_nonzero_idx = idx
		break
n = s[:idx + 1]
length = len(n)

def isPalindrome(n):
	for i in range(length // 2):
		if n[i] != n[length - 1 - i]:
			return False
	return True
print('YES' if isPalindrome(n) else 'NO')


n = input()
z_cnt = 0
flag = 0
if n[0] == '0':
	for x in n:
		if x == '0' and flag == 0:
			z_cnt += 1
		else:
			flag = 1
	n = z_cnt * '0' + n
else:
	n = n[::-1]
	for x in n:
		if x == '0' and flag == 0:
			z_cnt += 1
		else:
			flag = 1
	n = n + z_cnt * '0'
i = n[::-1]
if i == n:
	print('YES')
else:
	print('NO')


x = input()
m = list(x)
for i in range(len(m)):
	if m[len(m) - 1] == '0':
		del m[len(m) - 1]
p = False
for i in range(len(m)):
	if m[i] != m[len(m) - i - 1]:
		p = True
if p == False:
	print('YES')
else:
	print('NO')


n = str(input())
for i in range(len(n) - 1, -1, -1):
	if n[i] != '0':
		break
k = i + 1
f = 0
for i in range(k // 2):
	if n[i] != n[k - 1 - i]:
		f = 1
		break
if f == 1:
	print('NO')
else:
	print('YES')


s = input()
while s != s[::-1]:
	s = '0' + s
	if len(s) > 40:
		break
print('YNEOS'[len(s) > 40::2])


import sys
w = sys.stdin.readline().strip()
a = w.rstrip('0')
b = len(w) - len(a)
c = a.lstrip('0')
d = len(a) - len(c)
if d > b:
	print('NO')
elif c == c[::-1]:
	print('YES')
else:
	print('NO')


import sys
s = input()
cnt1 = cnt2 = no = 0
p = -1
q = len(s)
for i in range(len(s)):
	if s[i] == '0':
		cnt1 += 1
	else:
		p = i
		break
for i in range(len(s) - 1, -1, -1):
	if s[i] == '0':
		cnt2 += 1
	else:
		q = i
		break
s2 = s[p:q + 1]
if cnt1 > cnt2:
	no = 1
else:
	for i in range(len(s2) // 2):
		if s2[i] != s2[len(s2) - 1 - i]:
			no = 1
			break
if no == 1:
	print('NO')
else:
	print('YES')


s = int(input())
while s % 10 == 0 and s != 0:
	s //= 10
s = str(s)
for i in range(len(s) // 2):
	if s[i] != s[-i - 1]:
		print('NO')
		exit()
print('YES')


st = input()
num = int(st)
num = int(''.join(reversed(list(str(num)))))
num2 = int(''.join(reversed(list(str(num)))))
if num == num2:
	print('YES')
else:
	print('NO')


a = input().strip('0')
print('YES' if list(a) == list(reversed(a)) else 'NO')


class CodeforcesTask863ASolution:

	def __init__(self):
		self.result = ''
		self.number = 0

	def read_input(self):
		self.number = int(input())

	def process_task(self):
		last_zeros = 0
		for c in str(self.number)[::-1]:
			if c == '0':
				last_zeros += 1
			else:
				break
		palindrom_number = '0' * last_zeros + str(self.number)
		if palindrom_number == palindrom_number[::-1]:
			self.result = 'YES'
		else:
			self.result = 'NO'

	def get_result(self):
		return self.result
Solution = CodeforcesTask863ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


x = str(input())
a = x.count('0')
s = ''
if a > 0:
	while x.count('0') <= 2 * a:
		if x == x[::-1]:
			s = 1
			break
		x = '0' + x
elif x == x[::-1]:
	s = 1
if s == 1:
	print('yes')
else:
	print('no')


a = input()
a = int(a[::-1])
if str(a) == str(a)[::-1]:
	print('YES')
else:
	print('NO')


x = input()
n = x.replace('0', '')
if len(n) == 0:
	exit(print('YES'))
x = x.replace('0', '', x.find(n[0]))[::-1]
x = x.replace('0', '', x.find(n[-1]))
print('YES' if x == x[::-1] else 'NO')


def main(var):
	while var and var[-1] == '0':
		var = var[:-1]
	x = var[:int(len(var) / 2)]
	y = var[int(len(var) / 2):]
	if len(x) != len(y):
		y = y[1:]
	x = list(x)
	y = list(reversed(y))
	if x == y:
		return 'YES'
	else:
		return 'NO'
var = input()
print(main(var))


a = [0] * 10
n = input()
t = 0
s = len(n) - 1
while s >= 0 and n[s] == '0':
	t += 1
	s -= 1
n = '0' * t + n
for j in range(len(n) // 2):
	if n[j] != n[len(n) - 1 - j]:
		exit(print('NO'))
print('YES')


input = input()
input = input.rstrip('0')
quasi = True
for i in range(len(input)):
	j = len(input) - 1 - i
	if input[i] != input[j]:
		quasi = False
		print('NO')
		break
if quasi:
	print('YES')


a = list(input())
while a[-1] == '0':
	a.pop()
ans = 'YES'
for i in range(len(a) // 2):
	if a[i] != a[-1 - i]:
		ans = 'NO'
print(ans)


from sys import exit
n = input()
(first_idx, last_idx) = (0, 0)
i = len(n) - 1
while i > -1:
	if n[i] != '0':
		last_idx = i
		break
	i -= 1
for i in range(len(n)):
	if n[i] != '0':
		first_idx = i
		break
print('YES' if n[first_idx:last_idx + 1][::-1] == n[first_idx:last_idx + 1] else 'NO')


cv = int(input())
while cv % 10 == 0:
	cv = cv // 10
cv = str(cv)
z = cv[::-1]
if cv == z:
	print('yes')
else:
	print('no')


s = input()
a = s[::-1]
c = 0
for i in a:
	if i == '0':
		c += 1
	else:
		break
a = a[c:]
if a == a[::-1]:
	print('YES')
else:
	print('NO')


s = input()
s = s.strip('0')
l = len(s)
for i in range(0, l // 2):
	if s[i] != s[l - 1 - i]:
		print('NO')
		exit()
print('YES')


l = input().strip('0')
print('YES' if l[::-1] == l else 'NO')


n = input()
g = 1
t = 'YES'
while n[-g] == '0':
	g += 1
for i in range((len(n) - g + 1) // 2):
	if n[i] != n[-g - i]:
		t = 'NO'
print(t)


f = input()
f = int(f)
while f % 10 == 0:
	f = f // 10
f = str(f)
if len(f) == 1:
	print('Yes')
elif f[0:len(f) // 2:1] == f[:(len(f) + 1) // 2 - 1:-1]:
	print('Yes')
else:
	print('No')


x = input()
for i in range(10):
	if list(x) == list(x)[::-1]:
		print('YES')
		break
	x = '0' + x
else:
	print('NO')


from sys import exit
x = input()
cnt_first = cnt_last = 0
for c in x:
	if c == '0':
		cnt_first += 1
	else:
		break
for c in x[::-1]:
	if c == '0':
		cnt_last += 1
	else:
		break
x = '0' * max(0, cnt_last - cnt_first) + x
for i in range(len(x)):
	if x[i] != x[-i - 1]:
		print('NO')
		exit(0)
print('YES')


n = input()
for i in range(len(n) - 1, -1, -1):
	if n[i] == '0':
		continue
	else:
		p = n[:i + 1]
		if p == p[::-1]:
			print('YES')
		else:
			print('NO')
		break


s = list(input())
n = len(s)
(t, flag) = (1, 1)
z = s[::-1]
for i in z:
	if i == '0':
		t += 1
	else:
		break
for i in range(t):
	for j in range(n):
		if s[j] == s[-(j + 1)]:
			pass
		else:
			flag = 0
			break
		flag = 1
	s.insert(0, '0')
	n += 1
if flag == 1:
	print('YES')
else:
	print('NO')


n = input().strip('0')
print(['NO', 'YES'][n == n[::-1]])


def main():
	s = input().strip('0')
	print('YES' if s[::-1] == s else 'NO')
main()


def solve():
	s1 = list(input())
	s2 = s1.copy()
	s2.reverse()
	if s1 == s2:
		print('YES')
	else:
		for i in range(len(s2)):
			if s2[0] == '0':
				del s2[0]
			else:
				break
		s3 = s2.copy()
		s3.reverse()
		if s2 == s3:
			print('YES')
		else:
			print('NO')
solve()


def main():
	n = list(input())
	while len(n) > 0 and n[-1] == '0':
		n.pop()
	for i in range(len(n) // 2):
		if n[i] != n[-i - 1]:
			print('NO')
			return
	print('YES')
main()


import math
a = str(input())

def palindrome(a):
	n = len(a)
	if n % 2 == 0:
		for i in range(int(n / 2)):
			if a[i] != a[n - i - 1]:
				return False
		return True
	else:
		for i in range(math.floor(n / 2)):
			if a[i] != a[n - i - 1]:
				return False
		return True
i = 1
while i != 0:
	if palindrome(a):
		print('YES')
		i = 0
	elif a[-1] == '0':
		a = a[:-1]
	else:
		i = 0
		print('NO')


a = input()
while a[-1] == '0':
	a = a[:-1]
if a == a[::-1]:
	print('YES')
else:
	print('NO')


x = input()
k = 0
for i in range(len(x) - 1, 0, -1):
	if x[i] == '0':
		k += 1
	else:
		break
z = x[:len(x) - k]
m = len(z) - 1
flag = 0
for i in range(len(z) // 2):
	if z[i] != z[m]:
		flag = 1
		break
	m -= 1
if flag == 1:
	print('NO')
else:
	print('YES')


t = input()
if t == t[::-1]:
	print('YES')
else:
	t = t[::-1]
	i = 0
	m = len(t)
	count = 0
	str = ''
	while i < m:
		if t[i] == '0':
			count += 1
		elif int(t[i]) > 0:
			break
		i += 1
	for k in list(range(0, count)):
		str = '0' + str
	str = str + t[::-1]
	if str == str[::-1]:
		print('YES')
	else:
		print('NO')


a = int(input())
a1 = str(a)
a2 = a1[::-1]
k = int(0)
for i in range(len(a2)):
	if int(a2[i]) == 0:
		k += 1
	else:
		break
a3 = str(k * '0')
a4 = a3 + a1
a5 = a4[::-1]
if a4 == a5:
	print('YES')
else:
	print('NO')


def pal(s):
	l = len(s)
	if l % 2 == 0:
		k = l // 2
	else:
		k = l // 2 + 1
	if s[:l // 2] == ''.join(reversed(s[k:])):
		return True
	else:
		return False
s = input()
i = len(s) - 1
while s[i] == '0':
	i -= 1
j = 0
while s[j] == '0':
	j += 1
if pal(s[j:i + 1]):
	print('YES')
else:
	print('NO')


s = input()
pos = len(s) - 1
while s[pos] == '0':
	pos -= 1
s1 = s[:pos + 1]
if s1 == s1[::-1]:
	print('YES')
else:
	print('NO')


def ispalindrom(pal):
	lpal = list(pal)
	rlpal = list(lpal)
	rlpal.reverse()
	if lpal == rlpal:
		return True
	for i in rlpal:
		if int(i) != 0:
			break
		else:
			lpal.pop()
	rlpal = list(lpal)
	rlpal.reverse()
	if lpal == rlpal:
		return True
	return False
inp = int(input())
res = 'NO'
if ispalindrom(str(inp)):
	res = 'YES'
print(res)


def is_palindrome(string):
	lenn = len(string)
	bound = int(lenn / 2)
	for i in range(int(lenn / 2)):
		if string[i] != string[lenn - i - 1]:
			return False
	return True
s = input()
can = is_palindrome(s)
if not can:
	n = len(s)
	string_list = []
	for i in range(n):
		string_list.append(s[i])
	while string_list[n - 1] == '0':
		string_list.pop()
		n = len(string_list)
	can = is_palindrome(string_list)
if can:
	print('YES')
else:
	print('NO')


x = input().strip('0')
if x == ''.join(reversed(x)):
	print('YES')
else:
	print('NO')


num = str(input())
index = len(num) - 1
while index >= 0:
	if num[index] == '0':
		index -= 1
	else:
		break
output = 'YES'
(p1, p2) = (0, index)
while p1 < p2:
	if num[p1] == num[p2]:
		p1 += 1
		p2 -= 1
	else:
		output = 'NO'
		break
print(output)


num = int(input())
while num % 10 == 0:
	num = num / 10
num = int(num)
ans = str(num)
if ans == ans[::-1]:
	print('YES')
else:
	print('NO')


a = input('')
b = list(map(int, list(a[::-1])))
c = b.index(list(filter(lambda x: x != 0, b))[0]) * '0' + a
if c == c[::-1]:
	print('YES')
else:
	print('NO')


n = input()
n = n.strip('0')
k = 1
for x in range(len(n)):
	if n[x] == n[len(n) - k]:
		k += 1
if k - 1 == len(n):
	print('YES')
else:
	print('NO')


n = input()
for j in n[::-1]:
	if j == '0':
		n = n[:-1]
	else:
		break
x = n[::-1]
if int(x) == int(n):
	print('YES')
else:
	print('NO')


def rev(line):
	l = line[::-1]
	return l

def numGenerator(line):
	rev_f = rev(line)
	pos = 0
	for i in rev_f:
		if i == '0':
			pos += 1
		else:
			break
	rev_f = rev_f[pos:]
	pos = 0
	for i in range(1, len(rev_f)):
		if rev_f[-i] == '0':
			pos += 1
		else:
			break
	rev_f = rev_f[:len(rev_f) - pos]
	return rev_f

def numInitiator(line):
	pos = 0
	for i in line:
		if i == '0':
			pos += 1
		else:
			break
	line = line[pos:]
	pos = 0
	for i in range(1, len(line)):
		if line[-i] == '0':
			pos += 1
		else:
			break
	line = line[:len(line) - pos]
	return line

def palindrome(line):
	rev = numGenerator(line)
	line = numInitiator(line)
	if rev == line:
		print('YES')
	else:
		print('NO')

def main():
	line = input()
	palindrome(line)
main()


Number = input()
while Number[0] == '0':
	Number = Number[1:]
Number = ''.join(reversed(Number))
while Number[0] == '0':
	Number = Number[1:]
print('YES' if Number == ''.join(reversed(Number)) else 'NO')


s = input()
ctr = 0
if s != s[::-1]:
	for x in s[::-1]:
		if x == '0':
			ctr += 1
		else:
			break
	if ctr:
		sn = s[:-1 * ctr]
	else:
		sn = s
	if sn == sn[::-1]:
		print('YES')
	else:
		print('NO')
else:
	print('YES')


s = input()
j = len(s) - 1
i = 0
while s[j] == '0':
	j -= 1
	if s[i] == '0':
		i -= 1
res = True
for x in range(i, j + 1):
	if s[x] != s[j - x]:
		res = False
		break
print('YES' if res else 'NO')


n = input()
b = list(n)
b2 = list(b)
b2.reverse()
if b == b2:
	print('YES')
else:
	for i in b2:
		if i == '0':
			b.insert(0, '0')
			b2.append('0')
		else:
			break
	if b == b2:
		print('YES')
	else:
		print('NO')


from collections import deque as de
import math
from collections import Counter as cnt
from functools import reduce
from typing import MutableMapping

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))
x = input()
nz = 0
for i in range(len(x) - 1, -1, -1):
	if x[i] != '0':
		break
	else:
		nz += 1
s = '0' * nz + x
if s == s[::-1]:
	print('YES')
else:
	print('NO')


import math
import sys
input = sys.stdin.readline

def isPalindrome(s):
	i = 0
	l = len(s)
	while i <= int(l / 2):
		if s[i] != s[l - i - 1]:
			return 0
		i += 1
	return 1
x = ''.join(reversed(input().replace('\n', ''))).lstrip('0')
print('YES' if isPalindrome(x) else 'NO')


def palindrom(n):
	while n % 10 == 0:
		n = n // 10
	l = list(str(n))
	for i in range(len(l)):
		if l[i] != l[-i - 1]:
			print('NO')
			return
	print('YES')
	return
n = input()
palindrom(int(n))


import sys
for line in sys.stdin:
	for var in line.split():
		r = var[::-1]
		for b in r:
			if b != '0':
				break
			if var[0] != b:
				var = var[:-1]
		r = var[::-1]
	if var == r:
		print('YES')
	else:
		print('NO')


def palindrome(s):
	rev_str = reversed(s)
	return list(s) == list(rev_str)

def quasi(s):
	return palindrome(str(int(s[::-1])))
s = input()
if quasi(s):
	print('YES')
else:
	print('NO')


s = input()
l = -1
for i in range(len(s)):
	if s[i] != '0':
		l = i
		break
if l == -1:
	print('YES')
else:
	r = len(s)
	for i in range(len(s) - 1, -1, -1):
		if s[i] != '0':
			r = i
			break
	s1 = s[l:r + 1]
	s2 = s1[::-1]
	if s1 == s2:
		print('YES')
	else:
		print('NO')


def polindrom(s):
	st2 = ''
	for i in s:
		st2 = i + st2
	return st2
a = input()
k = 0
test = True
while test:
	if k > 8 or a == polindrom(a):
		if a == polindrom(a):
			test = True
		else:
			test = False
		break
	else:
		a = '0' + a
		k += 1
if test:
	print('YES')
else:
	print('NO')


n = input()
x = int(n)
s = n[::-1]
y = int(s)
for i in range(10):
	if x == y:
		print('YES')
		exit()
	y = y * 10
print('NO')


text = input()
rez = 0
for i in range(len(text)):
	zd = i * '0' + text
	if zd == zd[::-1]:
		rez = 1
		break
print('YES' if rez else 'NO')


k = input()
lenk = len(k)
start = -1
if lenk == 1:
	print('YES')
else:
	for i in range(1, lenk + 1):
		if k[0] == k[lenk - i]:
			start = lenk - i
			break
		elif int(k[lenk - i]) != 0:
			break
	if start == -1:
		print('NO')
	else:
		for i in range(0, start):
			if i < start - i:
				if k[i] != k[start - i]:
					start = -1
					print('NO')
					break
			else:
				break
		if start != -1:
			print('YES')


x = input()
p = list(x)
i = len(x) - 1
l = 0
if p[i] == '0':
	while p[i] == '0':
		i -= 1
while l < i:
	if p[l] != p[i]:
		print('NO')
		break
	l += 1
	i -= 1
else:
	print('YES')


x = str(input())
while x[-1] == '0':
	x = x[:-1]
found = False
for i in range(int(len(x) / 2)):
	if x[i] != x[-(i + 1)]:
		print('NO')
		found = True
		break
if not found:
	print('YES')


x = int(input())
x = str(x)
n = len(x) - 1
t = ''
flag = True
while flag == True and n >= 0:
	if x[n] == '0':
		t += '0'
		n -= 1
	else:
		flag = False
x = t + x
if x[-1::-1] == x:
	print('YES')
else:
	print('NO')


x = input()
n = len(x)
ans1 = 0
ans2 = 0
for i in range(n):
	if x[i] != '0':
		ans1 = i
		break
x = x[::-1]
for i in range(n):
	if x[i] != '0':
		ans2 = i
		break
x = x[::-1]
if ans1 < ans2:
	x = '0' * (ans2 - ans1) + x
else:
	x = x + '0' * (ans1 - ans2)
if x == x[::-1]:
	print('YES')
else:
	print('NO')


def main():
	n = input()
	print(solver(n))

def solver(s):
	leading = leadingZeros(s)
	ending = leadingZeros(s[::-1])
	if leading <= ending:
		if isPalindrome(s[leading:len(s) - ending]):
			return 'YES'
		else:
			return 'NO'
	else:
		return 'NO'

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

def leadingZeros(s):
	for i in range(len(s)):
		if s[i] != '0':
			return i
	return len(s)
main()


S = input()
T = S.strip('0')
T1 = T[::-1]
if T1 == T:
	print('YES')
else:
	print('NO')


s = input()
n = 10
while n and s != s[::-1]:
	s = '0' + s
	n -= 1
if n == 0:
	print('NO')
else:
	print('YES')


def main():
	s = input().rstrip('0')
	print(('NO', 'YES')[s == s[::-1]])
main()


p = input()
if p == p[::-1] or len(p) == 1:
	print('YES')
elif p[0] != p[len(p) - 1] and '0' not in [p[0], p[len(p) - 1]]:
	print('NO')
else:
	(cl, cr) = ('', '')
	for i in p:
		if i == '0':
			cl += '0'
		else:
			break
	for i in p[::-1]:
		if i == '0':
			cr += '0'
		else:
			break
	if cl == cr and p != p[::-1]:
		print('NO')
	elif len(cl) > len(cr):
		p += '0' * (len(cl) - len(cr))
		if p == p[::-1]:
			print('YES')
		else:
			print('NO')
	else:
		p = '0' * (len(cr) - len(cl)) + p
		if p == p[::-1]:
			print('YES')
		else:
			print('NO')


x = int(input())
x = list(str(x))
while len(x) > 1:
	if x[-1] == '0':
		x = x[:-1]
	else:
		break
alert = 0
for i in range(int(len(x) / 2)):
	if x[i] != x[-i - 1]:
		print('NO')
		alert = 1
		break
if alert == 0:
	print('YES')


A = list(input())
while len(A) > 0 and A[-1] == '0':
	A.pop()
B = list(reversed(A))
print('YES' if A == B else 'NO')


t = input()
for i in range(len(t) - 1, -1, -1):
	if t[i] != '0':
		break
f = 0
l = i
OK = True
while f < i:
	if t[f] != t[l]:
		OK = False
		break
	f += 1
	l -= 1
if OK:
	print('YES')
else:
	print('NO')


s = input()
t = ''
flag = True
for i in range(len(s) - 1, -1, -1):
	if flag and s[i] == '0':
		continue
	else:
		flag = False
		t += s[i]
if t == t[::-1]:
	print('YES')
else:
	print('NO')


def isPalindrome(s):
	n = len(s)
	i = 0
	while i * 2 < n:
		if s[i] != s[n - 1 - i]:
			return False
		i += 1
	return True
if isPalindrome(input().rstrip('0')):
	print('YES')
else:
	print('NO')


def ispal(s):
	if s == s[::-1]:
		return True
	else:
		return False
s = str(input())
if ispal(list(s)):
	print('YES')
	return
l = list(s)
while l[-1] == '0':
	l = l[:-1]
if ispal(l):
	print('YES')
else:
	print('NO')


def is_pal(s):
	return s == s[::-1]
s = input()
i = int(s)
j = 0
while i % 10 == 0:
	j += 1
	i /= 10
s = str(int(i))
if is_pal(s):
	print('YES')
else:
	print('NO')


w = input().strip('0')
print(['NO', 'YES'][list(w) == list(reversed(w))])


q = 1
while q > 0:
	q -= 1
	n = input()
	i = len(n) - 1
	temp = n.strip('0')
	if temp == temp[::-1]:
		print('YES')
	else:
		print('NO')


x = input()
if x == x[::-1]:
	print('YES')
else:
	n = x
	for c in x[::-1]:
		if c == '0':
			n = '0' + n
		else:
			break
	if n == n[::-1]:
		print('YES')
	else:
		print('NO')


a = input()
n = len(a)
c = n - len(a.rstrip('0'))
a = '0' * c + a
print('YNEOS'[a != a[::-1]::2])


def pol(n):
	c = n
	length = len(n)
	count1 = 0
	count2 = 0
	if n[len(n) - 1] == '0':
		for i in range(len(n) - 1, -1, -1):
			if n[i] == '0':
				count1 += 1
			else:
				break
	if n[0] == '0':
		return 'NO'
	if count1 - count2 != 0:
		for i in range(count1 - count2):
			n = '0' + n
		t = ''.join(reversed(c))
		if n[:length] == t:
			return 'YES'
		else:
			return 'NO'
	elif c == ''.join(reversed(n)):
		return 'YES'
	else:
		return 'NO'
print(pol(input().strip()))


def ispalindrome(x):
	len1 = len(x)
	c = 0
	for i in range(len1 // 2):
		if x[i] != x[len1 - i - 1]:
			c = 1
	if c == 0:
		return True
	else:
		return False
n = input()
c = 0
ff = len(n)
for i in range(ff):
	if n[ff - i - 1] == '0':
		if ispalindrome(n[:ff - i - 1]):
			c = 1
			break
	else:
		break
if c == 1 or ispalindrome(n):
	print('YES')
else:
	print('NO')


n = str(input())
if '0' in n:
	k = n.strip('0')
	reverse_ = k[::-1]
	if k == reverse_:
		print('YES')
	else:
		print('NO')
else:
	reverse_2 = n[::-1]
	if n == reverse_2:
		print('YES')
	else:
		print('NO')


def f(s):
	return s[:len(s) // 2] == s[len(s):(len(s) - 1) // 2:-1]
s = input()
for i in range(len(s) - 1, -1, -1):
	if s[i] != '0':
		break
if f(s[:i + 1]):
	print('YES')
else:
	print('NO')


n = int(input())
while not n % 10:
	n //= 10
if str(n) == str(n)[::-1]:
	print('YES')
else:
	print('NO')


import sys
s = input()
while s and s[-1] == '0':
	s = s[:-1]
if s == s[::-1]:
	print('YES')
else:
	print('NO')


s = input().strip('0')
if s == s[::-1]:
	print('yes')
else:
	print('no')


a = input()
for i in range(11):
	s = '0' * i + a
	if s == s[::-1]:
		print('YES')
		break
else:
	print('NO')


n = input()
d = []
j = False
for i in range(len(n) - 1, -1, -1):
	if n[i] != '0' or j:
		j = True
		d.append(n[i])
if d == list(reversed(d)):
	print('YES')
else:
	print('NO')


n = int(input())
add = 0
while n % 10 == 0:
	n = n // 10
t = n
while n != 0:
	add = add * 10 + n % 10
	n = n // 10
if t == add:
	print('YES')
else:
	print('NO')


t = input().rstrip('0')
if t == t[::-1]:
	print('YES')
else:
	print('NO')


import math
import re

def ria():
	return [int(i) for i in input().split()]
st = input()
for i in range(20):
	rst = reversed(st)
	if list(st) == list(rst):
		print('YES')
		exit(0)
	st = '0' + st
print('NO')


n = input()
if n == n[::-1]:
	print('YES')
elif int(n) % 10 != 0:
	print('NO')
else:
	for x in range(len(n) - 1, -1, -1):
		if n[x] != '0':
			p = x
			break
	k = n[:p + 1]
	if k == k[::-1]:
		print('YES')
	else:
		print('NO')


str = input()
for char in reversed(str):
	if char == '0':
		str = str[:-1]
	else:
		break
if str == str[::-1]:
	print('YES')
else:
	print('NO')


x = int(input()[::-1])
print('YES' if str(x) == str(x)[::-1] else 'NO')


x = int(input())
arr = []

def palindromic(arr):
	(i, j) = (0, len(arr) - 1)
	while i < j:
		if arr[i] != arr[j]:
			return False
		i = i + 1
		j = j - 1
	return True

def quasi_palindromic(x):
	n = x
	b = True
	while n:
		m = n % 10
		if m == 0:
			if b:
				pass
			else:
				arr.append(m)
		else:
			arr.append(m)
			b = False
		n = n // 10
	return palindromic(arr)
if quasi_palindromic(x):
	print('YES')
else:
	print('NO')


n = input()

def zcount(a):
	i = 0
	for x in a:
		if x == '0':
			i += 1
		else:
			break
	return i

def palindrome(n):
	if n == n[::-1]:
		return 1
	else:
		return 0
if palindrome(n) or palindrome('0' * (zcount(n[::-1]) - zcount(n)) + n):
	print('YES')
else:
	print('NO')


s = input()
d = 0
for i in range(0, len(s)):
	if s[len(s) - i - 1] == '0':
		d = d + 1
	else:
		break
t = s[0:len(s) - d]
if t == t[::-1]:
	print('YES')
else:
	print('NO')


from sys import stdin, stdout
s = stdin.readline().strip()
label = 0
for i in range(20):
	f = '0' * i + s
	if f == f[::-1]:
		label = 1
if label:
	stdout.write('YES')
else:
	stdout.write('NO')


s = input()
l = len(s)
c = ''
for i in range(l):
	if s[l - i - 1] == '0':
		c = c + '0'
	else:
		break
s1 = c + s
l1 = len(s1)
mid = l1 // 2
flag = 0
for i in range(mid):
	if s1[i] != s1[l1 - i - 1]:
		flag = 1
		break
if flag == 1:
	print('NO')
else:
	print('YES')


s = list(input())
while s and s[-1] == '0':
	s.pop()
s1 = s[:]
s1.reverse()
print('YES' if s == s1 else 'NO')


n = int(input())
while n % 10 == 0:
	n = n / 10
saven = n
b = 0
while saven > 0:
	b = 10 * b + saven % 10
	saven = int(saven / 10)
if b == n:
	print('YES')
else:
	print('NO')


s = input().strip('0')
print('YES' if all((s[i] == s[-1 - i] for i in range(len(s)))) else 'NO')


a = list(input())
k = 0
for i in range(len(a) - 1, -1, -1):
	if a[i] == '0':
		k += 1
	else:
		break
b = a[0:len(a) - k]
d = []
for i in range(len(b) - 1, -1, -1):
	d.append(b[i])
for i in range(len(b)):
	if b[i] != d[i]:
		print('NO')
		exit()
print('YES')


c = str(input())
x = len(c) - len(c.rstrip('0'))
c = x * '0' + c
l = len(c)
if len(c) % 2 != 0:
	j = c[:l // 2]
	k = c[l // 2 + 1:]
	k = k[::-1]
else:
	j = c[:l // 2]
	k = c[l // 2:]
	k = k[::-1]
if j == k:
	print('YES')
else:
	print('NO')


s = input()
n = len(s)
k = 0
i = n - 1
while s[i] == '0':
	i -= 1
	k += 1
s = '0' * k + s
s_p = ''.join(reversed(list(s)))
if s == s_p:
	print('YES')
else:
	print('NO')


s = input().strip()
l = [x for x in s]
while len(s) > 0 and l[-1] == '0':
	l.pop()
if l == l[::-1]:
	print('YES')
else:
	print('NO')


n = input()
i = 0
while len(n) != 0 and n[0] == '0':
	n = n[1:]
while len(n) != 0 and n[len(n) - 1] == '0':
	n = n[:len(n) - 1]
l = len(n)
s = True
for i in range(0, int(l / 2)):
	if n[i] == n[len(n) - i - 1]:
		continue
	else:
		s = False
		break
if s:
	print('YES')
else:
	print('NO')


s = input().strip()
i = len(s) - 1
while s[i] == '0' and i > 0:
	s = s[:len(s) - 1]
	i -= 1
if len(s) % 2 == 0:
	s1 = s[:len(s) // 2]
	s2 = s[len(s) // 2:]
else:
	s1 = s[:len(s) // 2]
	s2 = s[len(s) // 2 + 1:]
if s1 == s2[::-1]:
	print('YES')
else:
	print('NO')


n = input()
n = str(n).strip('0')
if n == n[::-1]:
	print('YES')
else:
	print('NO')


n = int(input())
while n % 10 == 0:
	n = n // 10
p = n
sum = 0
while n > 0:
	r = n % 10
	sum = sum * 10 + r
	n = n // 10
if sum == p:
	print('YES')
else:
	print('NO')


string = input()
i = 1
l = len(string)
while string[-i] == '0' and i <= l:
	string = '0' + string
	i += 1
if string[::-1] == string:
	print('YES')
else:
	print('NO')


def pal_check(s):
	k = len(s) - 1
	i = 0
	while i < len(s):
		if s[i] != s[k]:
			return False
		else:
			i = i + 1
			k = k - 1
	return True
a = input()
if pal_check(a) is True:
	print('YES')
else:
	d = 0
	j = 0
	l = len(a) - 1
	while l > 0:
		if a[l] == '0':
			d = d + 1
			l = l - 1
		else:
			break
	l = 0
	while l < len(a):
		if a[l] == '0':
			j = j + 1
			l = l + 1
		else:
			break
	while j < d:
		a = '0' + a
		j = j + 1
	if pal_check(a) is True:
		print('YES')
	else:
		print('NO')


num = input()
zeros = 0
for i in num[::-1]:
	if i == '0':
		zeros += 1
	else:
		break
print('YNEOS'[zeros * '0' + num != num[::-1] + zeros * '0'::2])


a = list(input())
if a == 11111111111111111111111111111111:
	print('NO')
else:
	for i in range(len(a) - 1, -1, -1):
		if a[i] == '0':
			a.pop(i)
		else:
			break
	p = len(a)
	p1 = a[:]
	p2 = p * [0]
	for i in range(p - 1, -1, -1):
		p2[p - i - 1] = a[i]
	if p1 == p2:
		print('YES')
	else:
		print('NO')


x = input()
x1 = x[::-1]
i = 0
while x1[0] == '0':
	x1 = x1[1:]
	i += 1
x2 = x1[::-1]
if x2 == x1:
	print('YES')
else:
	print('NO')


s = input()
for i in range(len(s)):
	if s[i] == '0':
		continue
	else:
		left = i
		break
for i in range(len(s) - 1, -1, -1):
	if s[i] == '0':
		continue
	else:
		right = i
		break
s = s[left:right + 1]
if s == s[::-1]:
	print('YES')
else:
	print('NO')


n = input()
n = list(n)
if n == n[::-1]:
	print('YES')
else:
	for i in range(len(n) - 1, -1, -1):
		if n[i] != '0':
			break
		else:
			del n[i]
	if n == n[::-1]:
		print('YES')
	else:
		print('NO')


s = input()
l = 0
r = len(s) - 1
while s[l] == '0' and l < r:
	l += 1
while s[r] == '0' and l < r:
	r -= 1
while s[l] == s[r] and l < r:
	l += 1
	r -= 1
if l >= r:
	print('YES')
else:
	print('NO')


def solve():
	n = int(input())
	n = str(n)
	if n == n[::-1]:
		return 'YES'
	count = 0
	for i in range(len(n) - 1, 0, -1):
		if n[i] == '0':
			count += 1
		else:
			break
	if count * '0' + n == n[::-1] + count * '0':
		return 'YES'
	return 'NO'
print(solve())


x = input()
_ = len(x) - 1
__ = 0
while True:
	if x[_] == '0':
		__ += 1
	else:
		break
	_ -= 1
___ = __ * '0' + x
print('YES' if ___ == ___[::-1] else 'NO')


n1 = int(input())
save = n1
n2 = 0
g = len(list(str(save)))
for i in range(g):
	if save % 10 == 0:
		save = save / 10
while n1 > 0:
	d = n1 % 10
	n1 = n1 // 10
	n2 = n2 * 10
	n2 = n2 + d
if save == n2:
	print('YES')
else:
	print('NO')


num = list(map(int, input()))
counter = 0
counter1 = 0
for x in num:
	if x == 0:
		counter += 1
	else:
		break
for y in range(len(num) - 1, 0, -1):
	if num[y] == 0:
		counter1 += 1
	else:
		break
if counter > counter1:
	for z in range(counter - counter1):
		num.append(0)
else:
	for z in range(counter1 - counter):
		num.insert(0, 0)
copy = [l for l in num]
num.reverse()
if copy == num:
	print('YES')
else:
	print('NO')


def solve():
	n = input()
	i = 0
	while n[-i - 1] == '0':
		n = '0' + n
		i += 1
	for i in range(len(n) // 2):
		if n[i] != n[-i - 1]:
			return 'NO'
	return 'YES'
print(solve())


x = input()
for i in range(len(x)):
	a = '0' * i + x
	if a == a[::-1]:
		print('YES')
		exit()
print('NO')


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

def main():
	x = input()
	first_nonzero_idx = 0
	for i in reversed(range(len(x))):
		if x[i] != '0':
			first_nonzero_idx = i
			break
	if is_palindrome(x[:first_nonzero_idx + 1]):
		print('YES')
	else:
		print('NO')
main()


x = input()
lzeros = 0
rzeros = 0
for i in range(len(x)):
	if x[i] == '0':
		lzeros += 1
	else:
		break
for i in range(len(x) - 1, -1, -1):
	if x[i] == '0':
		rzeros += 1
	else:
		break
same = True
if rzeros >= lzeros:
	if rzeros != lzeros:
		x = x[:-(rzeros - lzeros)]
	for i in range(len(x) // 2):
		if x[i] != x[len(x) - 1 - i]:
			same = False
else:
	same = False
if same:
	print('YES')
else:
	print('NO')


s = list(input())
l = 0
for i in range(len(s) - 1, -1, -1):
	if s[i] == '0':
		l += 1
	else:
		break
for i in range(l):
	s.insert(0, '0')
l = []
for i in range(len(s) - 1, -1, -1):
	l.append(s[i])
if l == s:
	print('YES')
else:
	print('NO')


def main():
	s = input()
	s = s[::-1]
	i = 0
	while i < len(s):
		if s[i] == '0':
			i += 1
		else:
			break
	s = s[i:]
	for (i, j) in zip(s, s[::-1]):
		if i != j:
			print('NO')
			return
	print('YES')
main()


s = input()
k = len(s) - 1
while k >= 0 and s[k] == '0':
	k -= 1
if s[:k + 1] == s[:k + 1][::-1]:
	print('YES')
else:
	print('NO')


a = input()
b = a[::-1]
for i in b:
	if i == '0':
		a = '0' + a
	else:
		break
b = a[::-1]
if a == b:
	print('Yes')
else:
	print('No')


def codeforces(number):
	number = str(number)
	while number[-1] == '0':
		number = number[:-1]
	for indx in range(len(number) // 2):
		if number[indx] != number[-indx - 1]:
			return 'NO'
	return 'YES'
number = input()
print(codeforces(number))


cnt = input()
fl1 = 0
fl2 = 0
s = -1
e = len(cnt)
for i in range(0, len(cnt)):
	if cnt[i] == '0' and fl1 == 0:
		s = i
	elif cnt[i] != '0':
		fl1 = 1
	if cnt[-i - 1] == '0' and fl2 == 0:
		e = -i - 1
	elif cnt[-i - 1] != '0':
		fl2 = 1
cnt = cnt[s + 1:e]
fl = 0
for i in range(len(cnt) // 2):
	if cnt[i] != cnt[-i - 1]:
		fl = 1
if fl == 1:
	print('NO')
else:
	print('YES')


s = input().rstrip('0')
print(('NO', 'YES')[s == s[::-1]])


x = str(input())
if x == x[::-1]:
	print('YES')
else:
	l_cnt = 0
	r_cnt = 0
	for i in range(len(x)):
		if x[i] == '0':
			l_cnt += 1
		else:
			break
	for i in range(len(x) - 1, -1, -1):
		if x[i] == '0':
			r_cnt += 1
		else:
			break
	x = (r_cnt - l_cnt) * '0' + x
	if x == x[::-1]:
		print('YES')
	else:
		print('NO')


k = int(input(''))
while k % 10 == 0:
	k = k / 10
new = int(k)
temp = new
rev = 0
while new > 0:
	dig = new % 10
	rev = rev * 10 + dig
	new = new // 10
if rev == temp:
	print('YES')
else:
	print('NO')


def main():
	n = input()
	for i in range(11):
		v = '0' * i + n
		if ''.join(reversed(v)) == v:
			print('YES')
			return
	print('NO')
main()


a = list(input())
while a[-1] == '0':
	a.pop()
if a[::-1] == a:
	print('Yes')
else:
	print('No')


s = input()
trg = True
while len(s) < 20:
	if s != s[::-1]:
		s = '0' + s
	else:
		trg = False
		break
print('YNEOS'[trg::2])


s = input()
l = len(s) * [0]
for i in range(len(s)):
	l[i] = int(s[i])
i = 0
while len(l) and s[0] == 0:
	l.remove(0)
j = len(l) - 1
while l[j] == 0 and j > -1:
	l.pop()
	j = j - 1
k = len(l) - 1
ans = 'YES'
for i in range(len(l) // 2):
	if l[i] != l[k]:
		ans = 'NO'
		break
	k -= 1
print(ans)


x = input()
j = ''

def check(x):
	j = 'YES'
	for i in range(len(x) // 2):
		if x[i] != x[len(x) - 1 - i]:
			j = 'NO'
	return j
cx = ''
if check(x) == 'YES':
	j = 'YES'
else:
	j = 'NO'
	for i in range(1, len(x)):
		cx = '0' * i
		cx = cx + x
		if check(cx) == 'YES':
			j = 'YES'
			break
print(j)


def palindrome(s):
	s = s.strip('0')
	s1 = s[::-1]
	if s == s1:
		print('YES')
	else:
		print('NO')
palindrome(input())


s = input()
s = list(s)
while s[-1] == '0':
	s.pop()
d = s[::-1]
print('YES' if d == s else 'NO')


def palindrome(s):
	n = len(s)
	i = 0
	j = n - 1
	while i <= j:
		if s[i] != s[j]:
			return False
		i += 1
		j -= 1
	return True
x = input()
n = len(x)
for i in range(n - 1, -1, -1):
	if palindrome(x[:i + 1]):
		index = i
		break
print('YES' if all((x[i] == '0' for i in range(index + 1, n))) else 'NO')


a = list(input())
for i in range(len(a)):
	a[i] = int(a[i])
k = False
j = 0
for i in range(len(a)):
	if a[i] == 0:
		k = True
	else:
		k = False
		j = 0
	if k:
		j += 1
if k:
	for i in range(j):
		a.pop()
j = len(a) - 1
k = 0
while j >= k:
	if a[j] == a[k]:
		sw = True
	else:
		sw = False
		k = j + 1
	j -= 1
	k += 1
if sw:
	print('YES')
else:
	print('NO')


a = input()
i = -1
x = 0
while a[i] == '0':
	i = i - 1
if i < -1:
	a = a[:i + 1]
y = -1
b = ''
c = ''
x = 0
if len(a) % 2 == 0:
	b = a[len(a) // 2:]
	for i in range(len(b) - 1, -1, -1):
		c += b[i]
	for i in range(len(c)):
		if c[i] != a[i]:
			x = 1
			break
	if x == 0:
		print('YES')
	else:
		print('NO')
else:
	b = a[len(a) // 2 + 1:]
	for i in range(len(b) - 1, -1, -1):
		c += b[i]
	for i in range(len(c)):
		if c[i] != a[i]:
			x = 1
			break
	if x == 0:
		print('YES')
	else:
		print('NO')


x = int(input())
while x % 10 == 0:
	x = x // 10
y = str(x)
k = 0
for i in range(len(y) // 2):
	if y[i] != y[len(y) - i - 1]:
		break
	else:
		k += 1
if k == len(y) // 2:
	print('YES')
else:
	print('NO')


n = int(input())
i = 0
while n % 10 ** (i + 1) == 0:
	i += 1
n = str(n)
p = 0
for j in range((len(n) - i) // 2):
	if n[j] != n[len(n) - 1 - i - j]:
		p += 1
if p == 0:
	print('YES')
else:
	print('NO')


n = list(input())
k = 0
i = -1
while n[i] == '0':
	k += 1
	i -= 1
n.reverse()
for i in range(k):
	n.append('0')
n.reverse()
x = n[:]
x.reverse()
if x == n:
	print('YES')
else:
	print('NO')


x = list(input())
for i in range(len(x) - 1, 0, -1):
	if int(x[i]) == 0:
		x.pop(i)
	else:
		break
print('YES' if x == x[::-1] else 'NO')


c = input()
ne = list(c)
while int(ne[-1]) == 0:
	ne.pop()
ans = 'YES'
for i in range(len(ne) // 2):
	if ne[i] != ne[-(i + 1)]:
		ans = 'NO'
print(ans)


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