Mike has a string s consisting of only lowercase English letters. He wants to change exactly one character from the string so that the resulting one is a palindrome. 

A palindrome is a string that reads the same backward as forward, for example strings "z", "aaa", "aba", "abccba" are palindromes, but strings "codeforces", "reality", "ab" are not.

Input

The first and single line contains string s (1 ≤ |s| ≤ 15).

Output

Print "YES" (without quotes) if Mike can change exactly one character so that the resulting string is palindrome or "NO" (without quotes) otherwise. 

Examples

Input

abccaa


Output

YES


Input

abbcca


Output

NO


Input

abcda


Output

YES

Source: codeforces | Difficulty: EASY
Tags: String algorithms

Complete search

Constructive algorithms


Solutions:
import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

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

def cdiv(n, k):
	return n // k + (n % k != 0)

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

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

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

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

def wr(arr):
	return ''.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base=3):
	newnumber = ''
	while number > 0:
		newnumber = str(number % base) + newnumber
		number //= base
	return newnumber
s = input()
t = 0
for i in range(len(s) // 2):
	if s[i] != s[-i - 1]:
		t += 1
if len(s) % 2 == 1 and t < 2 or (len(s) % 2 == 0 and t == 1):
	print('YES')
else:
	print('NO')


s = input()
t = (len(s) - 1) // 2
k = len(s) - len(s) % 2
c = False
for i in range(t + 1):
	if s[i] != s[-i - 1] and (not c):
		c = True
	elif s[i] != s[-i - 1] and c:
		print('NO')
		break
else:
	if not c and len(s) % 2 == 0:
		print('NO')
	else:
		print('YES')


s = input()
d = sum((s[i] != s[len(s) - i - 1] for i in range(len(s) // 2)))
print('YES' if d == 0 and len(s) % 2 or d == 1 else 'NO')


string = input()
if string[::-1] == string:
	if len(string) % 2 == 0:
		print('NO')
	else:
		print('YES')
else:
	cnt = 0
	for i in range(len(string)):
		if string[::-1][i] != string[i]:
			cnt += 1
	if cnt == 2:
		print('YES')
	else:
		print('NO')


s = input()
s = list(s)
a = []
b = []
d = 0
if len(s) % 2 == 0:
	a.append(s[:len(s) // 2])
	b.append(s[len(s) // 2:])
else:
	a.append(s[:len(s) // 2 + 1])
	b.append(s[len(s) // 2:])
a = sum(a, [])
b = sum(b, [])
for i in range(len(a)):
	if a[i] != b[len(a) - i - 1]:
		d += 1
if d == 1 and len(s) % 2 == 0:
	print('YES')
elif d == 0 and len(s) % 2 == 0:
	print('NO')
elif (d == 0 or d == 1) and len(s) % 2 != 0:
	print('YES')
else:
	print('NO')


N = str(input().split()[0])
P = N[-1::-1]
k = 0
for i in range(0, len(N)):
	if N[i] != P[i]:
		k += 1
if k == 0:
	if len(N) % 2 == 0:
		print('NO')
	else:
		print('YES')
elif k - 1 == 1:
	print('YES')
else:
	print('NO')


word = input().strip()
i = 0
j = len(word) - 1
count = 0
while i <= j:
	if word[i] != word[j]:
		count += 1
	i += 1
	j -= 1
if count == 1 or (count == 0 and len(word) % 2 == 1):
	print('YES')
else:
	print('NO')


import sys
s = list(sys.stdin.readline().strip())
count = 0
for i in range(len(s)):
	sAux = s[:]
	flag = False
	for j in range(1, 26):
		aux = ord(s[i]) + j
		if aux > 122:
			aux = aux % 122 + 96
		sAux[i] = chr(aux)
		r = sAux[:]
		r.reverse()
		if r == sAux:
			flag = True
			break
	if flag:
		break
if flag:
	print('YES')
else:
	print('NO')


import sys
s = str(input())
rev_s = s[::-1]
k = 0
for i in range(len(s)):
	if s[i] != rev_s[i]:
		s = s[:i] + rev_s[i] + s[i + 1:]
		k = 1
		break
	else:
		continue
if s == s[::-1] and k == 1:
	print('YES')
	sys.exit()
if s == s[::-1] and len(s) % 2 != 0:
	print('YES')
else:
	print('NO')


import math
s = input()
n = len(s)
a = s[:n // 2]
b = s[math.ceil(n / 2):][::-1]
c = 0
for i in range(len(a)):
	if a[i] != b[i]:
		c += 1
	if c > 1:
		break
print('YES' if c == 1 or (n % 2 == 1 and c == 0) else 'NO')


def check(s):
	for i in range(len(s)):
		if s[i] != s[len(s) - i - 1]:
			return False
	return True
s = input()
ans = 'NO'
for i in range(len(s)):
	for j in range(26):
		if chr(97 + j) == s[i]:
			continue
		new = s[:i] + chr(97 + j) + s[i + 1:]
		if check(new):
			ans = 'YES'
			break
print(ans)


s = input()
count = 0
l = len(s)
if l == 1:
	print('YES')
elif l & 1:
	for i in range((l - 1) // 2):
		if s[i] != s[l - 1 - i]:
			count += 1
		if count > 1:
			break
	if count == 0 or count == 1:
		print('YES')
	else:
		print('NO')
else:
	for i in range(l // 2):
		if s[i] != s[l - 1 - i]:
			count += 1
		if count > 1:
			break
	print('YES' if count == 1 else 'NO')


s = input()
k = 0
for i in range(len(s) // 2):
	if s[i] != s[-i - 1]:
		k += 1
if k == 1:
	print('YES')
elif k == 0 and len(s) % 2 == 1:
	print('YES')
else:
	print('NO')


s = input()
flag = False
fail = False
i = 0
j = len(s) - 1
while i <= j:
	if s[i] != s[j]:
		if flag:
			fail = True
			break
		if not flag:
			flag = True
	i += 1
	j -= 1
if len(s) % 2 == 1:
	print('NO' if fail else 'YES')
else:
	print('NO' if fail or not flag else 'YES')


(a, s) = (0, input())
for i in range(0, len(s)):
	if i >= len(s) - 1 - i:
		break
	if s[i] != s[len(s) - i - 1]:
		a += 1
print('YES' if a == 1 or len(s) == 1 or (a == 0 and len(s) % 2 == 1) else 'NO')


s = input()
cnt = 0
n = len(s) - 1
i = 0
while i < len(s):
	if s[i] != s[n - i]:
		cnt += 1
	i += 1
if cnt == 2:
	print('YES')
elif cnt == 0 and len(s) % 2 != 0:
	print('YES')
else:
	print('NO')


a = list(input())
n = len(a)
count = 0
for i in range(n // 2):
	if a[i] != a[n - i - 1]:
		count += 1
if len(a) % 2 == 1 and count == 0:
	count = 1
print('YES' if count == 1 else 'NO')


a = input()

def palindrome(a):
	f = ''
	for i in range(len(a) - 1, -1, -1):
		f = f + a[i]
	if f == a:
		return 1
	else:
		return 0
f = 'NO'
for i in range(len(a)):
	z = a
	for j in range(ord('a'), ord('z') + 1):
		if chr(j) != a[i]:
			z = a[:i] + chr(j) + a[i + 1:]
			if palindrome(z) == 1:
				f = 'YES'
				break
	if f == 'YES':
		break
print(f)


s = input()
for i in range(len(s)):
	for ch in 'qwertyuiopasdfghjklzxcvbnm':
		if ch == s[i]:
			continue
		s1 = s[0:i] + ch + s[i + 1:]
		if s1 == s1[::-1]:
			print('YES')
			exit()
print('NO')


s = input().strip()
n = len(s)
if n == 1:
	print('YES')
else:
	i = 0
	j = n - 1
	c = 0
	while i < j:
		if s[i] != s[j]:
			c += 1
		i += 1
		j -= 1
	if n % 2 == 0:
		print('YES' if c == 1 else 'NO')
	else:
		print('YES' if c <= 1 else 'NO')


def fu(st=str):
	tf = 1
	n = len(st)
	for i in range(0, n, 1):
		if st[i] != st[n - 1 - i]:
			tf = 0
	if tf == 0:
		return 0
	else:
		return 1
st = input()
tf = 0
if st[-1] == '\n':
	st = st[0:-1]
n = len(st)
for i in range(0, n, 1):
	if st[n - 1 - i] != st[i]:
		st1 = st[0:i] + st[n - 1 - i] + st[i + 1:n]
	else:
		st1 = st[0:i] + '.' + st[i + 1:n]
	if fu(st1) == 1:
		tf = 1
		break
if tf == 0:
	print('NO')
else:
	print('YES')


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	s = S()
	l = len(s)
	c = 0
	for i in range(l // 2):
		if s[i] != s[-i - 1]:
			c += 1
	if c == 1:
		return 'YES'
	if c == 0 and l % 2 == 1:
		return 'YES'
	return 'NO'
print(main())


s = input()
cnt = 0
p = len(s)
for i in range(p // 2):
	if s[i] != s[p - i - 1]:
		cnt += 1
if p == 1:
	print('YES')
elif p % 2 == 1:
	if cnt <= 1:
		print('YES')
	else:
		print('NO')
elif cnt == 1:
	print('YES')
else:
	print('NO')


s = input()
i = 0
j = len(s) - 1
c = 0
while i <= j:
	if s[i] != s[j]:
		c += 1
	i += 1
	j -= 1
if len(s) % 2 == 1 and c == 0:
	print('YES')
elif c == 1:
	print('YES')
else:
	print('NO')


s = input()
c = s
r = 0
while r < 2 and len(s) >= 3:
	if s[0] != s[-1]:
		r += 1
	s = s.replace(s[0], '', 1)
	s = s[::-1]
	s = s.replace(s[0], '', 1)
	s = s[::-1]
if len(s) == 2 and s[0] != s[-1]:
	r += 1
if r == 1 or (r == 0 and len(c) % 2 == 1):
	print('YES')
else:
	print('NO')


s = input()
res = 'NO'
for i in range(len(s)):
	for c in range(ord('a'), ord('z') + 1):
		zn = chr(c)
		t = s[:]
		if zn != s[i]:
			t = list(t)
			t[i] = zn
			if t == list(reversed(t)):
				res = 'YES'
print(res)


s = input()
if len(s) % 2 == 0:
	t = s[:len(s) // 2]
	y = s[len(s) // 2:]
	y = y[::-1]
	c = 0
	for i in range(len(s) // 2):
		if t[i] != y[i]:
			c = c + 1
	if c != 1:
		print('NO')
	else:
		print('YES')
else:
	t = s[:len(s) // 2]
	y = s[len(s) // 2 + 1:]
	y = y[::-1]
	c = 0
	for i in range(len(s) // 2):
		if t[i] != y[i]:
			c = c + 1
	if c > 1:
		print('NO')
	else:
		print('YES')


s = input()
l = len(s)
x = 0
for (n, m) in zip(s, reversed(s)):
	if n != m:
		x += 1
if x // 2 == 1 or (x == 0 and l % 2 == 1):
	print('YES')
else:
	print('NO')


def solvable(s):
	mismatch = False
	for i in range(len(s) // 2):
		if s[i] != s[-1 - i]:
			if mismatch:
				return False
			mismatch = True
	return mismatch or len(s) % 2 == 1
print('YES' if solvable(input()) else 'NO')


a = list(input())
ans = 0
for i in range(len(a) // 2):
	if a[i] != a[-i - 1]:
		ans += 1
	if ans == 2:
		exit(print('NO'))
print(['NO', 'YES'][ans or len(a) % 2])


mystring = input()
count = 0
for i in range(len(mystring) // 2):
	if mystring[i] != mystring[-1 - i]:
		count = count + 1
if count == 0:
	if len(mystring) % 2 == 0:
		print('NO')
	else:
		print('YES')
elif count == 1:
	print('YES')
else:
	print('NO')


str = list(input())
(l1, l2) = ([], [])
if len(str) & 1 == 1:
	l1 = str[:int((len(str) - 1) / 2)]
	l2 = str[int((len(str) - 1) / 2) + 1:len(str)]
else:
	l1 = str[:int(len(str) / 2)]
	l2 = str[int(len(str) / 2):len(str)]
l2.reverse()
ans = 0
for i in range(len(l1)):
	if l1[i] != l2[i]:
		ans += 1
	if ans > 1:
		break
if ans > 1:
	print('NO')
elif ans == 0 and len(str) & 1 == 1:
	print('YES')
elif ans == 1:
	print('YES')
else:
	print('NO')


x = input()
l = len(x)
f = 0
if x == x[::-1]:
	if l % 2 == 0:
		print('NO')
	else:
		print('YES')
elif l % 2 == 0:
	l1 = l // 2
	s = x[:l1]
	s1 = x[l1:]
	coun = 0
	for i in range(l1):
		if s1[i] != s[-1 - i]:
			coun += 1
			if coun > 1:
				print('NO')
				f = 1
				break
	if f == 0:
		print('YES')
else:
	l1 = l // 2
	s = x[:l1]
	s1 = x[l1 + 1:]
	coun = 0
	for i in range(l1):
		if s1[i] != s[-1 - i]:
			coun += 1
			if coun > 1:
				print('NO')
				f = 1
				break
	if f == 0:
		print('YES')


a = input()
l = len(a)
c = 0
for i in range(l // 2):
	if a[i] != a[-(i + 1)]:
		c += 1
if c == 1 or (l % 2 == 1 and c == 0):
	print('YES')
else:
	print('NO')


l = list('qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM')
a1 = input()
a = list(a1)
n = 0
for x in range(len(a)):
	for y in l:
		o = a[x]
		a[x] = y
		b = ''
		for k in a:
			b += k
		if b[::-1] == b and b != a1:
			n += 1
		a[x] = o
if n > 0:
	print('YES')
else:
	print('NO')


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


s = input()
if len(s) % 2 == 0:
	p = s[:len(s) // 2]
	o = s[:len(s) // 2 - 1:-1]
	ww = 0
	for i in range(len(p)):
		if o[i] != p[i]:
			ww += 1
	if ww != 1:
		print('NO')
	else:
		print('YES')
else:
	p = s[:len(s) // 2]
	o = s[:len(s) // 2:-1]
	ww = 0
	for i in range(len(p)):
		if o[i] != p[i]:
			ww += 1
	if ww > 1:
		print('NO')
	else:
		print('YES')


s = input()
n = len(s)
count = 0
if n % 2 == 0:
	for i in range(n // 2):
		if s[i] != s[n - i - 1]:
			count += 1
	if count == 1:
		print('YES')
	else:
		print('NO')
else:
	for i in range(n // 2):
		if s[i] != s[n - i - 1]:
			count += 1
	if count == 0 or count == 1:
		print('YES')
	else:
		print('NO')


s = input()
f = 0
x = 0
y = -1
if len(s) == 1:
	print('YES')
	exit()
if len(s) % 2 == 0:
	while x < len(s) / 2:
		if s[x] != s[y]:
			f += 1
		if f > 1:
			print('NO')
			exit()
		x += 1
		y -= 1
	if f == 1:
		print('YES')
		exit()
	if f == 0:
		print('NO')
		exit()
else:
	while x < (len(s) - 1) / 2:
		if s[x] != s[y]:
			f += 1
		if f > 1:
			print('NO')
			exit()
		x += 1
		y -= 1
	if f == 1:
		print('YES')
		exit()
	if f == 0:
		print('YES')
		exit()


s = input()
if len(s) == 1:
	print('YES')
else:
	s1 = ''
	s2 = ''
	for i in range(len(s) // 2):
		s1 += s[i]
	if len(s) % 2 == 0:
		for i in range(len(s) - 1, len(s) // 2 - 1, -1):
			s2 += s[i]
	else:
		for i in range(len(s) - 1, len(s) // 2, -1):
			s2 += s[i]
	ans = 0
	if s1 == s2 and len(s) % 2 == 1:
		print('YES')
		exit()
	for i in range(len(s1)):
		if s1[i] != s2[i]:
			ans += 1
	if ans == 1:
		print('YES')
	else:
		print('NO')


st = input()
differences = 0
for i in range(len(st) // 2):
	if st[i] != st[len(st) - i - 1]:
		differences += 1
if differences > 1:
	print('NO')
elif differences == 1:
	print('YES')
elif len(st) % 2 == 1:
	print('YES')
else:
	print('NO')


a = input()
n = len(a)
ctr = 0
for i in range(n // 2):
	if a[i] != a[n - 1 - i]:
		ctr += 1
if ctr >= 2:
	print('NO')
elif ctr == 0:
	if n % 2 == 0:
		print('NO')
	else:
		print('YES')
else:
	print('YES')


s = input().strip()
(i, j) = (0, len(s) - 1)
bad = 0
while i < j:
	if s[i] != s[j]:
		bad += 1
	i += 1
	j -= 1
if bad > 1:
	print('NO')
elif bad == 1:
	print('YES')
elif len(s) % 2 == 0:
	print('NO')
else:
	print('YES')


s = list(input())
(i, j) = (0, len(s) - 1)
(c, z) = (0, s[::-1])
if s == z:
	if len(s) % 2 == 0:
		print('NO')
	else:
		print('YES')
else:
	while i < j:
		if s[i] != s[j]:
			c += 1
		i += 1
		j -= 1
		if c > 1:
			break
	if c <= 1:
		print('YES')
	else:
		print('NO')


s1 = input()
s = s1
if len(s) % 2 == 1:
	s = s[:len(s) // 2] + s[len(s) // 2 + 1:]
lst1 = list(s[:len(s) // 2])
lst2 = list(s[len(s) // 2:])
lst2.reverse()
c = 0
for i in range(len(s) // 2):
	if lst1[i] != lst2[i]:
		c += 1
if c == 1 or len(s) == 0 or (lst1 == lst2 and len(s1) % 2 == 1):
	print('YES')
else:
	print('NO')


s = input()
s1 = s
s2 = s[::-1]
c = 0
for i in range(len(s) // 2):
	if s1[i] == s2[i]:
		c += 1
	else:
		ind = i
if s1 == s2:
	if len(s) % 2 != 0:
		print('YES')
	else:
		print('NO')
elif c == len(s) // 2 - 1:
	print('YES')
else:
	print('no')


s = input()
count = 0
i = 0
j = len(s) - 1
while i < j:
	if s[i] != s[j]:
		count += 1
	i = i + 1
	j = j - 1
if count == 1:
	print('YES')
elif count == 0:
	if len(s) % 2 == 0:
		print('NO')
	else:
		print('YES')
else:
	print('NO')


S = str(input())
chars = []
chars2 = []
count = 0
for i in S:
	chars.append(i)
for i in range(0, len(chars)):
	chars2.append(chars[len(chars) - 1 - i])
for i in range(0, len(chars)):
	if chars[i] != chars2[i]:
		count = count + 1
if chars2 == chars and len(chars) % 2 != 0:
	print('YES')
elif count == 2:
	print('YES')
else:
	print('NO')


s = input()
z = len(s)
cnt = 0
for i in range(z // 2):
	if s[i] != s[z - i - 1]:
		if cnt == 1:
			cnt = 2
			break
		cnt = 1
if cnt:
	print('YES' if cnt == 1 else 'NO')
else:
	print('YES' if z % 2 else 'NO')


s = input()
n = len(s)
counter = 0
for i in range(n // 2):
	if s[i] != s[n - 1 - i]:
		counter += 1
if counter == 0:
	if n % 2 == 0:
		print('NO')
	else:
		print('YES')
elif counter == 1:
	print('YES')
else:
	print('NO')


from sys import stdin, stdout

def ri():
	return map(int, stdin.readline().split())
s = input()
l = len(s)
flag = 0
for i in range(l):
	if i >= l // 2:
		break
	if s[i] != s[-i - 1]:
		if flag:
			print('NO')
			exit()
		flag = 1
if flag:
	print('YES')
elif l % 2:
	print('YES')
else:
	print('NO')


s = list(str(input()))
f = 0
for i in range(len(s) // 2):
	if s[i] != s[-1 - i]:
		f += 1
if f == 1:
	print('YES')
elif f == 0 and len(s) % 2 == 1:
	print('YES')
else:
	print('NO')


def main():
	string = input('')
	wordlist = list(string)
	error = 0
	for x in range(len(wordlist)):
		if wordlist[x] == wordlist[len(wordlist) - x - 1]:
			pass
		else:
			error += 1
		if error > 2:
			print('NO')
			return
	if error == 0 and len(wordlist) % 2 == 0:
		print('NO')
		return
	print('YES')
	return
main()


L = input()
c = 0
n = len(L) - 1
for i in range(len(L) // 2):
	if L[i] != L[n]:
		c = c + 1
		n = n - 1
	elif c > 1:
		flag = 1
		print('NO')
		break
	else:
		n = n - 1
else:
	if c > 1 or (c == 0 and len(L) % 2 == 0):
		print('NO')
	else:
		print('YES')


str = input()
ok = 0
str2 = str
for q in range(len(str)):
	str = str2
	ok2 = 1
	if str[q] == str[len(str) - 1 - q] and q != len(str) - 1 - q:
		continue
	str = ''
	str += str2[0:q]
	str += str2[len(str2) - q - 1:len(str2) - q]
	if q + 1 < len(str2):
		str += str2[q + 1:len(str2)]
	for i in range(len(str)):
		if str[i] is not str[len(str) - 1 - i]:
			ok2 = 0
	if ok2 == 1:
		ok = 1
if ok:
	print('YES')
else:
	print('NO')


s = input()
mid = len(s) // 2
if len(s) % 2 == 1:
	mid = len(s) // 2 + 1
first = s[:len(s) // 2]
last = s[mid:]
last = last[::-1]
c = 0
for i in range(len(first)):
	if first[i] != last[i]:
		c += 1
if c == 0 and len(s) % 2 == 1 and (first == last):
	print('YES')
elif c == 1:
	print('YES')
else:
	print('NO')


x = input()
for i in range(len(x)):
	for j in 'abcdefghijklmnopqrstuvwxyz':
		if j == x[i]:
			continue
		s = x[:i] + j + x[i + 1:]
		if s == s[::-1]:
			print('YES')
			quit()
print('NO')
quit()


def Invertir(L):
	var = ''
	for h in L:
		var = h + var
	return var
L = input()
IL = Invertir(L)
AL = []
AIL = []
for k in L:
	AL.append(k)
for k in IL:
	AIL.append(k)
c = 0
if AL == AIL:
	if len(AL) % 2 == 0:
		print('NO')
	else:
		print('YES')
elif len(L) == 2 or len(L) == 1:
	print('YES')
else:
	for k in range(len(L)):
		if AL[k] != AIL[k]:
			c += 1
	if c == 0:
		print('YES')
	elif c == 2:
		print('YES')
	else:
		print('NO')


import sys
t = 1
while t > 0:
	s = input()
	limit = 0
	for i in range(len(s) // 2):
		if not s[i] == s[-i - 1]:
			limit += 1
	if limit == 1:
		print('YES')
	elif not (len(s) % 2 == 1 and limit == 0):
		print('NO')
	else:
		print('YES')
	t -= 1


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


import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy
from itertools import chain, dropwhile, permutations, combinations
from collections import defaultdict, deque

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

def I():
	return int(input())

def LIST(n, m=None):
	return [0] * n if m is None else [[0] * m for i in range(n)]

def ELIST(n):
	return [[] for i in range(n)]

def MI(n=None, m=None):
	if n is None:
		(n, m) = VI()
	arr = LIST(n)
	for i in range(n):
		arr[i] = VI()
	return arr

def MS(n=None, m=None):
	if n is None:
		(n, m) = VI()
	arr = LIST(n)
	for i in range(n):
		arr[i] = input()
	return arr

def MIT(n=None, m=None):
	if n is None:
		(n, m) = VI()
	a = MI(n, m)
	arr = LIST(m, n)
	for (i, l) in enumerate(a):
		for (j, x) in enumerate(l):
			arr[j][i] = x
	return arr

def run(n, x, l, r):
	s = 0
	curr = 1
	for i in range(n):
		skip = (l[i] - curr) // x
		s += r[i] - curr - skip * x + 1
		curr = r[i] + 1
	print(s)

def main(info=0):
	s = input()
	if s == s[::-1]:
		if len(s) % 2 == 1:
			print('YES')
		else:
			print('NO')
		return
	d = 0
	for (a, b) in zip(s, s[::-1]):
		if a != b:
			d += 1
	if d == 2:
		print('YES')
	else:
		print('NO')
main()


s1 = input()
cnt = 0
for i in range(0, len(s1) // 2):
	if s1[i] != s1[len(s1) - i - 1]:
		cnt += 1
if cnt == 1:
	print('YES')
elif cnt == 0:
	if len(s1) % 2 != 0:
		print('YES')
	else:
		print('NO')
elif cnt > 1:
	print('NO')


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


s = input()
f = s[:len(s) // 2]
if len(s) % 2 != 0:
	b = s[len(s) // 2 + 1:]
else:
	b = s[len(s) // 2:]
b = b[::-1]
flag = 0
for i in range(len(f)):
	if f[i] != b[i]:
		flag += 1
if flag == 1 or (flag == 0 and len(s) % 2 != 0):
	print('YES')
else:
	print('NO')


s = list(input())
for i in range(len(s)):
	was = s[i]
	for j in range(26):
		s[i] = chr(ord('a') + j)
		if s[i] == was:
			continue
		if s == s[::-1]:
			print('YES')
			exit()
	s[i] = was
print('NO')


from collections import deque
from collections import Counter
from itertools import permutations
import heapq

def counterExample():
	arr = [1, 3, 4, 1, 2, 1, 1, 3, 4, 3, 5, 1, 2, 5, 3, 4, 5]
	counter = Counter(arr)
	top_three = counter.most_common(3)
	print(top_three)
q = deque()

def main():
	string = input()
	j = len(string) - 1
	i = 0
	count = 0
	while i < j:
		if string[i] != string[j]:
			count += 1
		i += 1
		j -= 1
	if count > 1:
		print('NO')
	if count == 0 and len(string) % 2 == 1:
		print('YES')
	if count == 0 and len(string) % 2 == 0:
		print('NO')
	if count == 1:
		print('YES')
main()


t = list(input())
k = len(t)
cc = 0
i = 0
while i <= k - i - 1:
	if t[i] != t[k - i - 1]:
		cc = cc + 1
	i = i + 1
if cc == 1:
	print('YES')
elif cc == 0 and k % 2 == 1:
	print('YES')
else:
	print('NO')


def check_palindrome(x):
	if x is None:
		print(0)
	l_x = x
	(i, j) = (0, len(l_x) - 1)
	count_ueq = 0
	for i in range(0, len(l_x) // 2):
		if l_x[i] != l_x[j]:
			if count_ueq > 1:
				return 'NO'
			count_ueq += 1
		j -= 1
	if len(l_x) % 2 == 0 and count_ueq == 1:
		return 'YES'
	elif len(l_x) % 2 == 1 and count_ueq <= 1:
		return 'YES'
	else:
		return 'NO'
x_str = str(input())
print(check_palindrome(x_str))


s = input()
changes = 0
length = len(s)
for i in range(length // 2):
	if not s[i] == s[length - i - 1]:
		changes += 1
if changes == 1 or (changes == 0 and (not length % 2 == 0)):
	print('YES')
else:
	print('NO')


def is_palindrome(s):
	return s == s[::-1]

def to_make_palindrome(s):
	letters = set(s)
	letters_list = list(s)
	for i in range(len(letters_list)):
		starter = letters_list[i]
		for change in letters:
			letters_list[i] = change
			string = ''.join(letters_list)
			if string == string[::-1]:
				return True
		letters_list[i] = starter
	return False
a = input()
if a == a[::-1]:
	if len(a) % 2 != 0:
		print('YES')
	else:
		print('NO')
elif not to_make_palindrome(a):
	print('NO')
else:
	print('YES')


def maine():
	n = int(input())
	arr = [None] * n
	for i in range(n):
		arr[i] = input()
	l = len(arr[0])
	c = arr[0]
	b = [0] * n
	for j in range(1, n):
		s = arr[j]
		flag = False
		for d in range(l):
			for i in range(l):
				if s[i] != c[(d + i) % l]:
					break
			else:
				b[j] = d
				flag = True
				break
			if flag:
				break
		else:
			print(-1)
			return
	res = 10 ** 10
	for end in range(l):
		p = 0
		for start in b:
			if start > end:
				p += l - start + end
			else:
				p += end - start
		res = min(p, res)
	print(res)

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


s = str(input())
if len(s) == 1:
	print('Yes')
else:
	i = 0
	e = 0
	while i < len(s) // 2:
		if s[i] != s[len(s) - i - 1]:
			e = e + 1
		else:
			pass
		i = i + 1
	if e == 1:
		print('YES')
	elif e == 0:
		if len(s) % 2 == 0:
			print('NO')
		else:
			print('YES')
	else:
		print('NO')


import sys
inp = sys.stdin.readline()
inp_ = [inp[i] for i in range(len(inp) - 1)]

def f(x):
	S = 0
	for i in range(0, int(0.5 * len(x))):
		if x[i] != x[len(x) - i - 1]:
			S += 1
	return S
if f(inp_) == 0 and len(inp_) % 2 == 1 or f(inp_) == 1:
	print('YES')
else:
	print('NO')


s = input()
n = len(s)
flag = 0
j = 0
for i in range(n // 2):
	if s[i] != s[-i - 1]:
		j += 1
if j == 1 and n % 2 == 0:
	print('YES')
elif (j == 0 or j == 1) and n % 2 == 1:
	print('YES')
else:
	print('NO')


x = list(input())
a = len(x)
if a == 1:
	print('Yes')
elif x == x[-1::-1]:
	if a % 2 != 0:
		print('YES')
	else:
		print('NO')
else:
	for i in range(a // 2):
		if x[i] != x[-1 - i]:
			x[i] = x[-1 - i]
			if x == x[-1::-1]:
				print('YES')
				break
			else:
				print('NO')
				break


def is_almost_palindrome(word: str):
	diff_count = 0
	left_idx = 0
	right_idx = len(word) - 1
	while left_idx < right_idx:
		if word[right_idx] != word[left_idx]:
			diff_count += 1
		right_idx -= 1
		left_idx += 1
	if diff_count == 1 or (diff_count == 0 and right_idx == left_idx):
		return True
	return False
print('YES' if is_almost_palindrome(input()) else 'NO')


from copy import copy
import sys
s = [c for c in input()]
for c in map(chr, range(97, 123)):
	for i in range(len(s)):
		k = copy(s)
		if k[i] == c:
			continue
		k[i] = c
		x = ''.join(k)
		if x == x[::-1]:
			print('YES')
			sys.exit(0)
print('NO')


n = input()
a = len(n)
c = 0
if a % 2 == 0:
	p = n[:a // 2]
	q = n[a // 2:]
	q = q[::-1]
else:
	p = n[:a // 2 + 1]
	q = n[a // 2 + 1:]
	q = q[::-1]
for i in range(a // 2):
	if p[i] == q[i]:
		pass
	else:
		c += 1
if c > 1 or (c == 0 and a % 2 == 0):
	print('NO')
else:
	print('YES')


a = input()
l = len(a)
t = 0
for i in range(int(l / 2)):
	if a[i] != a[l - i - 1]:
		t += 1
if t == 1:
	print('YES')
elif t == 0:
	if l % 2 == 0:
		print('NO')
	else:
		print('YES')
else:
	print('NO')


n = input()
s = [i for i in n]
l = 0
d = []
for i in range(len(n) // 2):
	if s[i] == s[-i - 1]:
		pass
	else:
		l += 1
		pass
if l == 1 or (l == 0 and len(s) % 2 != 0):
	print('YES')
else:
	print('NO')


palindromeInput = input().strip()
palindromeInputReverse = palindromeInput[::-1]
counter = 0
for (letterA, letterB) in zip(palindromeInput, palindromeInputReverse):
	if letterA != letterB:
		counter += 1
if len(palindromeInput) % 2 != 0 and counter == 0:
	print('YES')
elif counter == 2:
	print('YES')
else:
	print('NO')


import sys
import math

def main():
	s = sys.stdin.readline().strip()
	n = len(s)
	x = 0
	for i in range(n // 2):
		if s[i] != s[n - 1 - i]:
			x += 1
	print('NYOE S'[x == 1 or (n % 2 != 0 and x == 0)::2])
main()


List = input()
(control, head, tail) = (1, 0, len(List) - 1)
while head <= tail:
	if List[head] != List[tail]:
		control -= 1
	(head, tail) = (head + 1, tail - 1)
if control < 0 or (control == 1 and len(List) % 2 == 0):
	print('NO')
else:
	print('YES')


def main():
	word = input()
	mid = len(word) // 2
	part1 = word[:mid]
	mid = mid + len(word) % 2
	part2 = word[mid:][::-1]
	flag = False
	for (a, b) in zip(part1, part2):
		if a != b:
			if not flag:
				flag = True
			else:
				break
	else:
		if flag or len(word) % 2 == 1:
			print('YES')
			return
	print('NO')
main()


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


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


import sys
s = input()
length = len(s)
c = s[0]
flag = 0
for char in s:
	if char != c:
		flag = 1
if length == 1 or (flag == 0 and length % 2 != 0):
	print('YES')
	sys.exit()
half = int(length / 2)
counter = 0
for i in range(half):
	if s[i] != s[length - (i + 1)]:
		counter += 1
if length % 2 != 0 and counter == 0 or counter == 1:
	print('YES')
else:
	print('NO')


x = input()
k = 0
for i in range(len(x)):
	if x[i] != x[len(x) - 1 - i]:
		k += 1
	if k > 2:
		break
if k == 2 or (k == 0 and len(x) % 2 != 0):
	print('YES')
else:
	print('NO')


s = input()
l = len(s) // 2
s1 = s[:l]
if len(s) % 2 == 0:
	s2 = s[l:][::-1]
else:
	s2 = s[l + 1:][::-1]
i = 0
Q = 0
while i < l:
	if s1[i] != s2[i]:
		Q += 1
	i += 1
if Q == 1 or (Q == 0 and len(s) % 2 == 1):
	print('YES')
else:
	print('NO')


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


st = list(input())
ok = False
for i in range(len(st)):
	at = st[i]
	for j in range(ord('a'), ord('z') + 1):
		st[i] = chr(j)
		if at != chr(j) and st == st[::-1]:
			ok = True
	st[i] = at
if ok:
	print('YES')
else:
	print('NO')


S = input()
if len(S) % 2 == 0:
	Z = S[len(S) // 2:]
else:
	Z = S[len(S) // 2 + 1:]
Z1 = S[:len(S) // 2]
c = 0
Z = Z[::-1]
for i in range(len(Z)):
	if Z[i] != Z1[i]:
		c = c + 1
if c == 1 or (c == 0 and len(S) % 2 != 0):
	print('YES')
else:
	print('NO')


s = input()
cnt = 0
new_s = s[::-1]
for i in range(len(s)):
	if s[i] != new_s[i]:
		cnt += 1
if s == new_s and len(s) % 2 == 0:
	print('NO')
	exit()
elif s == new_s and len(s) % 2 != 0:
	print('YES')
	exit()
if cnt == 2:
	print('YES')
else:
	print('NO')


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from heapq import *
from copy import deepcopy
from collections import deque
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 10 ** 9 + 7

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for pp in range(t):
		solve(pp)

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def google(p):
	print('Case #' + str(p) + ': ', end='')

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

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

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 solve(case):
	s = inp()
	n = len(s)
	cnt = 0
	for i in range(n // 2):
		if s[i] != s[n - i - 1]:
			cnt += 1
	if cnt == 1:
		print('YES')
	elif cnt == 0:
		if n % 2 == 1:
			print('YES')
		else:
			print('NO')
	else:
		print('NO')
testcase(1)


def check_p():
	s = input()
	i = 0
	j = len(s) - 1
	count = 0
	while i <= j:
		if s[i] != s[j]:
			count += 1
		if count > 1:
			return False
		i += 1
		j -= 1
	if len(s) % 2 == 0 and count == 0:
		return False
	return True
if check_p():
	print('YES')
else:
	print('NO')


str = input()
num = 0
length = len(str)
for i in range(length // 2):
	if str[i] != str[length - i - 1]:
		num += 1
flag = 0
if length % 2 == 0 and num == 1:
	flag = 1
if length % 2 == 1 and num <= 1:
	flag = 1
if flag == 1:
	print('YES')
else:
	print('NO')


pol = input()
l = len(pol)
if len(pol) % 2 != 0:
	pol = pol[:int((l - 1) / 2)] + pol[int((l + 1) / 2):]

def main(pol):
	global l
	errs = 0
	for i in range(int(len(pol) / 2)):
		if pol[i] != pol[len(pol) - 1 - i] and errs == 1:
			return 'NO'
		elif pol[i] != pol[len(pol) - 1 - i] and errs == 0:
			errs += 1
	if errs == 1:
		return 'YES'
	elif l % 2 != 0:
		return 'YES'
	else:
		return 'NO'
print(main(pol))


s1 = input()
s2 = s1[::-1]
sum = 0
for (x, y) in zip(s1, s2):
	if x != y:
		sum = sum + 1
if sum == 2:
	print('YES')
elif sum == 0 and len(s1) % 2:
	print('YES')
else:
	print('NO')


import webbrowser
if True == False:
	url = input()
	while True:
		webbrowser.open(url)
else:
	s = input()
	c = 0
	for i in range((len(s) + 1) // 2):
		if s[i] != s[len(s) - i - 1]:
			c = c + 1
	if c >= 2:
		print('NO')
	elif c == 0 and len(s) % 2 == 0:
		print('NO')
	else:
		print('YES')


s = input()
c = 0
i = 0
flag = True
while i < int(len(s) / 2) and flag:
	if s[i] != s[len(s) - i - 1]:
		c += 1
	if c > 1:
		flag = False
	i = i + 1
if c == 1:
	print('YES')
elif c == 0:
	if len(s) % 2 == 0:
		print('NO')
	else:
		print('YES')
else:
	print('NO')


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


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

def solve():
	s = st()
	i = 0
	j = len(s) - 1
	n = len(s)
	c = 0
	while i <= j:
		c += s[i] != s[j]
		i += 1
		j -= 1
	if c == 1:
		pr('YES')
	elif c == 0:
		if n & 1:
			pr('YES')
		else:
			pr('NO')
	else:
		pr('NO')
for _ in range(1):
	solve()


x = input()
y = x[::-1]
c = 0
t = 'YES'
for i in range(len(x)):
	if x[i] != y[i]:
		c += 1
	if c > 2:
		t = 'NO'
		break
if c == 0 and len(x) % 2 == 1:
	t = 'YES'
elif c == 0 and len(x) % 2 == 0:
	t = 'NO'
print(t)


s = input()
count = 0
possible = True
for i in range(int(len(s) / 2)):
	if s[i] != s[len(s) - i - 1]:
		count += 1
		if count > 1:
			possible = False
			break
if len(s) % 2 == 1 and count == 0:
	count += 1
if possible and count == 1:
	print('YES')
else:
	print('NO')


myString = str(input())
if len(myString) % 2 == 0:
	firstHalf = myString[0:len(myString) // 2]
	secondHalf = myString[len(myString) // 2:]
else:
	firstHalf = myString[0:len(myString) // 2]
	secondHalf = myString[1 + len(myString) // 2:]
newSecondHalf = ''
for ch in secondHalf:
	newSecondHalf = ch + newSecondHalf
secondHalf = newSecondHalf
diffCount = 0
for i in range(0, len(firstHalf)):
	if firstHalf[i] != secondHalf[i]:
		diffCount += 1
if diffCount == 1 or (diffCount == 0 and len(myString) % 2 == 1):
	print('YES')
else:
	print('NO')


a = input()
a = list(a)
flag = 0
i = 0
j = len(a) - 1
while i < j:
	if a[i] != a[j]:
		a[i] = a[j]
		flag = 1
		break
	i += 1
	j -= 1
if a == a[::-1] and flag == 1:
	print('YES')
elif a == a[::-1] and len(a) % 2 != 0:
	print('YES')
else:
	print('NO')


import sys
s = sys.stdin.readline().strip()

def canDoPalindrom(s):
	anyLetters = 0
	for i in range((len(s) + 1) // 2):
		if s[i] != s[-1 - i]:
			anyLetters += 1
	if anyLetters == 1 or (anyLetters == 0 and len(s) % 2 == 1):
		return 'YES'
	else:
		return 'NO'

def doTest():
	assert canDoPalindrom('abccaa') == 'YES'
	assert canDoPalindrom('abbcca') == 'NO'
	assert canDoPalindrom('abcda') == 'YES'
print(canDoPalindrom(s))


a = list(input())
A = a[0:len(a) // 2]
if len(a) % 2 == 0:
	B = a[len(a) // 2:][::-1]
else:
	B = a[len(a) // 2 + 1:][::-1]
if A == B:
	if len(a) % 2 == 0:
		print('NO')
	else:
		print('YES')
else:
	n = 0
	for k in range(len(A)):
		if A[k] == B[k]:
			pass
		else:
			n += 1
	if n == 1:
		print('YES')
	else:
		print('NO')


s = input()
l = 0
for i in range(len(s) // 2):
	if s[i] != s[len(s) - 1 - i]:
		l += 1
if len(s) % 2 == 0 and l == 0 or l > 1:
	print('No')
else:
	print('Yes')


def com(s1, s2):
	d = 0
	for i in range(len(s1)):
		if s1[i] != s2[i]:
			d = d + 1
	return d
s = input()
if len(s) % 2 == 0 and len(s) != 1:
	if com(s[:int(len(s) / 2)], s[len(s) - 1:int(len(s) / 2) - 1:-1]) == 1:
		print('YES')
	else:
		print('NO')
elif len(s) % 2 != 0 and len(s) != 1:
	if com(s[:int(len(s) / 2)], s[len(s) - 1:int(len(s) / 2):-1]) <= 1:
		print('YES')
	else:
		print('NO')
else:
	print('YES')


s = input()
(i, l, dif) = (0, len(s) - 1, 0)
while l - i > i:
	if s[i] != s[l - i]:
		dif += 1
	i += 1
print('YES' if dif == 1 or (len(s) % 2 and dif == 0) else 'NO')


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


import sys
import math

def isPal(s):
	cnt = 0
	for i in range(len(s)):
		if s[i] != s[len(s) - i - 1]:
			cnt += 1
	return cnt
s = input()
cnt = isPal(s)
if cnt == 0 and len(s) % 2 == 0:
	print('NO')
elif cnt <= 2:
	print('YES')
else:
	print('NO')


s = input()
n = int(len(s))
if len(s) % 2 == 1:
	mid = int((n - 1) / 2)
	count = 0
	s1 = s[0:mid]
	s2 = s[n - 1:mid:-1]
	for i in range(len(s1)):
		if s1[i] != s2[i]:
			count += 1
	if count == 1 or count == 0:
		res = 'YES'
	else:
		res = 'NO'
else:
	count = 0
	s1 = s[0:int(n / 2)]
	s2 = s[n - 1:int(n / 2) - 1:-1]
	for i in range(int(n / 2)):
		if s1[i] != s2[i]:
			count += 1
	if count == 1:
		res = 'YES'
	else:
		res = 'NO'
print(res)


(Change, X) = (0, input())
for i in range(len(X) // 2):
	Change += 0 if X[i] == X[-(i + 1)] else 1
print('YES' if Change == 1 or (Change == 0 and len(X) % 2 != 0) else 'NO')


s = input()
s = list(s)
flag = False
for i in range(len(s)):
	if s[i] == s[len(s) - 1 - i] and 2 * i + 1 != len(s):
		continue
	tmp = s[i]
	s[i] = s[len(s) - 1 - i]
	ss = ''.join(s)
	if ss == ss[::-1]:
		flag = True
		break
	s[i] = tmp
print(flag and 'YES' or 'NO')


line = input()
half1 = 0
half2 = 0
if len(line) % 2 == 0:
	half1 = line[:len(line) // 2]
	half2 = line[len(line) // 2:len(line) + 1]
else:
	half1 = line[:(len(line) - 1) // 2]
	half2 = line[len(line) // 2 + 1:len(line) + 1]
temp = 0
for i in range(len(half2)):
	if half1[i] != half2[-(i + 1)]:
		temp += 1
if temp == 1:
	print('YES')
elif temp == 0 and len(line) % 2 != 0:
	print('YES')
else:
	print('NO')


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


try:
	s = input()
	l = list(s)
	i = 0
	j = len(l) - 1
	c = 0
	while i < j:
		if l[i] == l[j]:
			i += 1
			j -= 1
			pass
		elif c == 0:
			l[j] = l[i]
			c = 1
			i += 1
			j -= 1
		else:
			c = 2
			break
	if c == 1:
		print('YES')
	elif len(l) % 2 != 0 and c == 0:
		print('YES')
	else:
		print('NO')
except EOFError:
	pass


def find_palindrome(s):
	mid = len(s) // 2
	a = s[0:mid + 1]
	b = s[len(s) - 1:len(s) - 1 - mid:-1]
	t = 0
	for i in range(mid):
		if a[i] != b[i]:
			t += 1
	if t == 1:
		return 'YES'
	elif t == 0:
		if len(s) % 2 != 0:
			return 'YES'
		else:
			return 'NO'
	else:
		return 'NO'
print(find_palindrome(input()))


inp = input()
letters = list(set(inp))
lent = len(inp)
setlen = len(letters)
flag = 0

def sem(strr):
	leng = len(strr)
	for i in range(leng):
		if strr[0] != strr[i]:
			return False
	return True

def ispal(strr):
	leng = len(strr)
	for i in range(int(leng / 2)):
		if strr[i] != strr[leng - 1 - i]:
			return False
	return True
if sem(inp) == True:
	if len(inp) % 2 == 1:
		flag = 1
else:
	for i in range(lent):
		if lent == 1:
			flag = 1
			break
		for j in range(setlen):
			sem = list(inp)
			if sem[i] == letters[j]:
				continue
			sem[i] = letters[j]
			if ispal(sem) == True:
				flag = 1
				break
if flag == 0:
	print('NO')
else:
	print('YES')


import math
t = False
txt = list(input())
n = len(txt)
if n % 2 != 0:
	txt.pop(math.floor(n / 2))
n1 = math.floor(len(txt) / 2)
l1 = txt[0:n1]
l2 = txt[n1:]
l2.reverse()
j = 0
ans = []
for i in l1:
	if i != l2[j]:
		ans.append(j)
	j = j + 1
if len(ans) == 1:
	t = True
	print('YES')
if len(ans) == 0 and n % 2 != 0:
	t = True
	print('YES')
if t == False:
	print('NO')


import operator
s = input()
count = sum(map(operator.ne, s, s[::-1]))
odd = len(s) % 2 == 1
if count == 2 or (odd and count == 0):
	print('YES')
else:
	print('NO')


from sys import stdin, stdout
from sys import maxsize
input = stdin.readline

def solve():
	pass
test = 1
for t in range(0, test):
	s = list(input().strip())
	cnt = 0
	for i in range(len(s) // 2):
		if s[i] != s[len(s) - i - 1]:
			cnt += 1
	if cnt == 1:
		print('YES')
	elif cnt == 0 and len(s) % 2 == 1:
		print('YES')
	else:
		print('NO')
	ans = solve()


def isPal(s, i):
	j = 0
	while j < len(s) // 2 + (1 if len(s) % 2 == 1 else 0):
		if j != i:
			if s[j] != s[len(s) - 1 - j]:
				return False
		j += 1
	return True
s = input()
if len(s) % 2 != 1 and isPal(s, -1):
	print('NO')
	quit()
i = 0
while i < len(s) // 2 + (1 if len(s) % 2 == 1 else 0):
	if isPal(s, i):
		print('YES')
		quit()
	i += 1
print('NO')


s = list(input())
res = sum(map(lambda x, y: x != y, s, reversed(s)))
if res > 2:
	print('NO')
elif res == 2:
	print('YES')
elif len(s) & 1:
	print('YES')
else:
	print('NO')


string = list(input())
flag = 0
end = len(string) // 2
if len(string) % 2 != 0:
	end += 1
for i in range(end):
	if i == len(string) - i - 1:
		print('YES')
		exit(0)
	if string[i] != string[len(string) - i - 1]:
		if flag == 0:
			flag = 1
		else:
			print('NO')
			exit(0)
if flag:
	print('YES')
else:
	print('NO')


def judge(str, c):
	i = 0
	j = len(str) - 1
	while i <= j and (str[i] == str[j] or (str[i] == '#' and str[j] != c) or (str[j] == '#' and str[i] != c)):
		i = i + 1
		j = j - 1
	return i >= j

def solve(str):
	n = len(str)
	for i in range(0, n):
		now = str[0:i] + '#' + str[i + 1:]
		if judge(now, str[i]):
			return 'YES'
	return 'NO'
str = input().strip()
print(solve(str))


import sys

def solve():
	s = [ch for ch in input()]
	n = len(s)
	if n % 2 == 1 and s == list(reversed(s)):
		print('YES')
		return
	for i in range(n):
		tmp = s[i]
		if s[i] == s[n - 1 - i]:
			continue
		s[i] = s[n - 1 - i]
		if s == list(reversed(s)):
			print('YES')
			return
		s[i] = tmp
	print('NO')

def debug(x, table):
	for (name, val) in table.items():
		if x is val:
			print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
			return None
solve()


alph = 'qwertyuiopasdfghjklzxcvbnm'
s = input()
for ind in range(len(s)):
	for subs in alph:
		if subs == s[ind]:
			continue
		corrected = s[:ind] + subs + s[ind + 1:]
		revers = corrected[::-1]
		if revers == corrected:
			print('YES')
			quit(0)
print('NO')


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

def solve():
	s = input()
	(p, l) = (0, len(s))
	for i in range(l // 2):
		if s[i] != s[l - 1 - i]:
			p += 1
			if p > 1:
				print('NO')
				return
	print('YES' if p == 1 else 'YES' if l % 2 == 1 else 'NO')
tc = 1
for t in range(tc):
	solve()


a = input()

def m(t):
	cont = 0
	for k in range(len(t) // 2):
		if t[k] != t[-(k + 1)]:
			cont += 1
		if cont == 2:
			return 'NO'
	if cont == 0 and len(t) % 2 == 0:
		return 'NO'
	return 'YES'
print(m(a))


def main():
	s = input()
	a = 0
	b = len(s) - 1
	d = 0
	while a < b:
		if s[a] != s[b]:
			d += 1
		a += 1
		b -= 1
	safe = d == 1 or (d == 0 and len(s) % 2 == 1)
	print('YES' if safe else 'NO')
main()


S = input().strip()
N = len(S)
spoiler = 0
for i in range(N // 2):
	if S[i] == S[N - i - 1]:
		continue
	spoiler += 1
	if spoiler > 1:
		break
if spoiler == 1:
	print('YES')
elif spoiler == 0 and N % 2 == 1:
	print('YES')
else:
	print('NO')


s = input()
n = len(s)
if n % 2 == 0:
	a = s[:n // 2]
	b = s[n // 2:][::-1]
	c = sum((x != y for (x, y) in zip(a, b)))
	if c == 1:
		print('YES')
	else:
		print('NO')
else:
	a = s[:n // 2]
	b = s[n // 2 + 1:][::-1]
	c = sum((x != y for (x, y) in zip(a, b)))
	if c in [0, 1]:
		print('YES')
	else:
		print('NO')


s = input()
c = 0
pos = True
for i in range(int(len(s) / 2)):
	if s[i] != s[len(s) - i - 1]:
		c += 1
		if c > 1:
			pos = False
			break
if len(s) % 2 == 1 and c == 0:
	c += 1
if pos and c == 1:
	print('YES')
else:
	print('NO')


def para(s):
	for i in range(len(s)):
		if s[i] != s[len(s) - i - 1]:
			return False
	return True
s = input()
for i in range(len(s)):
	if (s[i] != s[len(s) - i - 1] or i == len(s) - i - 1) and para(s[:i] + s[len(s) - i - 1] + s[i + 1:]):
		print('YES')
		exit()
print('NO')


a = list(input())
n = len(a)
b = [i for i in a]
a.reverse()
c = [i for i in a]
d = zip(b[:n // 2], c[:n // 2])
x = 0
for i in d:
	x += 1 * (i[0] != i[1])
if n % 2 == 0:
	print(('NO', 'YES')[x == 1])
else:
	print(('NO', 'YES')[x == 1 or x == 0])


s = list(input())
x = 0
for i in range(len(s) // 2):
	if s[i] != s[-1 - i]:
		x += 1
	if x == 2:
		break
if x == 1:
	print('YES')
elif x == 0 and len(s) % 2 == 1:
	print('YES')
else:
	print('NO')


s = input()
s1 = s[len(s) // 2:]
if len(s) % 2 == 0:
	s2 = s[:len(s) // 2]
else:
	s2 = s[:len(s) // 2 + 1]
rev = ''
for j in range(len(s2)):
	rev = s2[j] + rev
if rev == s1:
	if len(s) % 2 != 0:
		print('YES')
	else:
		print('NO')
else:
	flag = 0
	for i in range(len(rev)):
		if rev[i] != s1[i]:
			flag += 1
	if flag == 1:
		print('YES')
	else:
		print('NO')


s = input()
s_ = list(reversed([x for x in s]))
num = 0
for i in range(len(s)):
	if s[i] != s_[i]:
		num = num + 1
if num == 0 and len(s) % 2 == 0:
	print('NO')
elif num == 0 and len(s) % 2 == 1:
	print('YES')
elif num == 2:
	print('YES')
else:
	print('NO')


n = input()
d = sum([i != j for (i, j) in zip(n, n[::-1])])
print(['NO', 'YES'][d == 2 or (d == 0 and len(n) % 2)])


x = input()
if len(x) % 2 == 0:
	x1 = x[:len(x) // 2]
	x2 = x[len(x) // 2:]
else:
	x1 = x[:len(x) // 2]
	x2 = x[len(x) // 2 + 1:]
x2 = x2[::-1]
x1 = list(x1)
x2 = list(x2)
if len(x) == 1:
	print('YES')
else:
	c = 0
	for i in range(len(x1)):
		if x1[i] != x2[i]:
			c += 1
			if c > 1:
				break
	if c == 1:
		print('YES')
	else:
		if c == 0 and len(x) % 2 != 0:
			print('YES')
		if c == 0 and len(x) % 2 == 0:
			print('NO')
		if c > 1:
			print('NO')


X = input()
L = int(len(X) // 2)
Z = 0
for I in range(0, L):
	if X[I] != X[-I - 1]:
		Z += 1
if Z == 1 or (Z == 0 and len(X) % 2 == 1):
	print('YES')
else:
	print('NO')


def ispal(s):
	if len(s) == 0 or len(s) == 1:
		return True
	elif s[0] == s[-1]:
		return ispal(s[1:-1])
	else:
		return False
s = str(input())
list1 = list(s)
count = 0
list2 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
list3 = list1[:]
count = 0
count1 = 0
for i in range(len(s)):
	list3 = list1[:]
	for c in list2:
		list3[i] = c
		if ispal(list1) and len(s) % 2 == 0:
			print('NO')
			count1 += 1
			break
		elif ispal(list3):
			print('YES')
			count += 1
			count1 += 1
			break
	if count1 > 0:
		break
if count == 0 and (not (ispal(list1) and len(s) % 2 == 0)):
	print('NO')


s = str(input())
k = 0
if len(s) % 2 == 0:
	a = s[0:len(s) // 2]
	b = s[len(s) // 2:len(s)]
else:
	a = s[0:len(s) // 2]
	b = s[len(s) // 2 + 1:len(s)]
c = b
b = []
for i in range(len(c) - 1, -1, -1):
	b.append(c[i])
for i in range(len(a)):
	if a[i] != b[i]:
		k += 1
if k == 0 and len(s) % 2 == 1:
	print('YES')
elif k == 1:
	print('YES')
else:
	print('NO')


s = input()
c = 0
for i in range(int(len(s) / 2)):
	j = len(s) - i - 1
	if s[i] != s[j]:
		c += 1
if c > 1:
	print('NO')
elif c == 0 and len(s) % 2 == 0:
	print('NO')
elif c == 0 and len(s) % 2 != 0:
	print('YES')
else:
	print('YES')


x = input()
a = len(x)
c = x[-1::-1]
d = 0
t = 0
for i in range(a // 2):
	if x[i] != c[i]:
		d += 1
	if d > 1:
		t = 1
		break
if d == 0:
	if t == 1:
		print('NO')
	elif a % 2 == 0:
		print('NO')
	else:
		print('YES')
elif t == 1:
	print('NO')
else:
	print('YES')


cnt = 0
str = input()
l = 0
r = len(str) - 1
while l <= r:
	if str[l] != str[r]:
		cnt = cnt + 1
	l = l + 1
	r = r - 1
if cnt == 0 and (len(str) == 1 or len(str) % 2):
	print('YES')
elif cnt == 1:
	print('YES')
else:
	print('NO')


import math as mt
import sys, string, bisect
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
d = defaultdict(int)
s = input().strip()
i = 0
j = len(s) - 1
a = 0
while i < j:
	if s[i] != s[j]:
		a += 1
		if a == 2:
			break
	i += 1
	j -= 1
if a == 1:
	print('YES')
elif len(s) % 2 == 1 and a == 0:
	print('YES')
else:
	print('NO')


a = input()
l = len(a)
k = 0
if l % 2 == 1:
	for i in range(l // 2 + 1):
		if a[i] != a[l - 1 - i]:
			k += 1
		if k > 1:
			print('NO')
			break
	if k == 0:
		print('YES')
else:
	for i in range(l // 2):
		if a[i] != a[l - 1 - i]:
			k += 1
		if k > 1:
			print('NO')
			break
	if k == 0:
		print('NO')
if k == 1:
	print('YES')


import sys

def solve():
	s = [ch for ch in input()]
	n = len(s)
	for i in range(n):
		if i != n - 1 - i and s[i] == s[n - 1 - i]:
			continue
		tmp = s[i]
		s[i] = s[n - 1 - i]
		if s == s[::-1]:
			print('YES')
			return
		s[i] = tmp
	print('NO')
solve()


a = input()
inv = a[::-1]
cont = 0
for i in range(len(a)):
	if a[i] != inv[i]:
		cont += 1
if cont == 2:
	print('YES')
elif cont == 0 and len(a) % 2 == 1:
	print('YES')
else:
	print('NO')


s = input()
count = 0
i = 0
j = len(s) - 1
ans = 'YES'
while i <= j:
	if s[i] != s[j]:
		if count == 1:
			ans = 'NO'
			break
		else:
			i += 1
			j -= 1
			count += 1
	else:
		i += 1
		j -= 1
if count == 0 and len(s) % 2 == 0:
	ans = 'NO'
print(ans)


s = input()
if s == s[::-1]:
	if len(s) % 2 == 0:
		print('NO')
	else:
		print('YES')
else:
	change = 0
	i = 0
	j = len(s) - 1
	while i <= j:
		if s[i] != s[j]:
			change += 1
		i += 1
		j -= 1
	if change == 1:
		print('YES')
	else:
		print('NO')


def solve(s):
	if len(s) == 1:
		print('YES')
		return
	counter = 0
	for i in range(len(s)):
		if s[i] == s[len(s) - 1 - i]:
			continue
		else:
			counter += 1
	counter /= 2
	if counter == 1 or (counter < 1 and len(s) % 2 == 1):
		print('YES')
	else:
		print('NO')
mystring = list(input())
solve(mystring)


def ans(s, c):
	if len(s) < 2:
		return c == 0
	sub = s[1:-1]
	if s[0] == s[-1]:
		return ans(sub, c)
	else:
		return ans(sub, c - 1)

def is_palindrome(s):
	return s == ''.join(reversed(s))
s = input()
if ans(s, 1) or (is_palindrome(s) and len(s) % 2 == 1):
	print('YES')
else:
	print('NO')


def fun(ss):
	if len(ss) < 2:
		return 0
	if ss[0] == ss[-1]:
		return fun(ss[1:-1])
	else:
		return 1 + fun(ss[1:-1])
ss = input()
print(['NO', 'YES'][[fun(ss) < 2, fun(ss) == 1][len(ss) % 2 == 0]])


s = str(input())
i = int(len(s) - 1)
s1 = ''
a = 0
while i >= 0:
	s1 = str(s1 + s[i])
	i = i - 1
for p in range(0, len(s)):
	if s[p] != s1[p]:
		a = a + 1
if a == 2:
	print('YES')
elif a == 0 and len(s) % 2 == 1:
	print('YES')
else:
	print('NO')


s = list(input())
i = 0
k = len(s) // 2
c = 0
while i < k:
	if s[i] != s[len(s) - 1 - i]:
		c += 1
	i += 1
if c == 1:
	print('YES')
elif c == 0 and len(s) % 2 == 1:
	print('YES')
else:
	print('NO')


str = input()
ls = len(str)
(i, j, ans) = (0, ls - 1, 0)
while i < j:
	if str[i] != str[j]:
		ans = ans + 1
	i = i + 1
	j = j - 1
if ans > 1 or (ans == 0 and ls & 1 == 0):
	print('NO')
else:
	print('YES')


a = input()
a = ' '.join(a)
a = a.split()
b = len(a)
contador = 0
inicio = 0
final = b - 1
d = b // 2
for k in range(d):
	if a[inicio] != a[final]:
		contador = contador + 1
	inicio = inicio + 1
	final = final - 1
if contador == 1:
	print('YES')
elif contador == 0 and b % 2 != 0:
	print('YES')
else:
	print('NO')


string = [x for x in input()]
reverse = string[::-1]
if string == reverse and len(string) % 2 == 1:
	print('YES')
else:
	for i in range(len(string)):
		if string[i] == reverse[i]:
			reverse[i] = ''
	count = 0
	for letter in reverse:
		if letter != '':
			count += 1
	print(['NO', 'YES'][count == 2])


s = input()
i = 0
j = len(s) - 1
f = 0
c = 0
while i < j:
	if s[i] == s[j]:
		if f == 1:
			f = 1
		else:
			f = 0
	else:
		f = 1
		c += 1
		if c > 1:
			f = 1
			break
	i += 1
	j -= 1
if f == 0:
	if len(s) % 2 == 0:
		print('NO')
	else:
		print('YES')
elif c == 1:
	print('YES')
else:
	print('NO')


s = input()
if s == s[::-1] and len(s) % 2:
	print('YES')
elif s == s[::-1] and len(s) % 2 == 0:
	print('NO')
else:
	f = 1
	n = len(s)
	c = 0
	for i in range(0, len(s) // 2):
		if s[i] != s[n - i - 1]:
			c += 1
			if c > 1:
				f = 0
				break
	print('YES' if f else 'NO')


from sys import stdin, stdout

def reverseStr(s):
	t = ''
	for i in range(len(s) - 1, -1, -1):
		t += s[i]
	return t
s = stdin.readline().rstrip()
n = len(s)
possible = False
for i in range((n + 1) // 2):
	scpy = list(s)
	scpy[i] = scpy[n - i - 1]
	scpy = ''.join(scpy)
	if scpy == reverseStr(scpy):
		possible = True
if s == reverseStr(s):
	if n % 2 == 1:
		possible = True
	else:
		possible = False
if possible:
	print('YES')
else:
	print('NO')


def palindrome(s):
	x = s[::-1]
	if s == x:
		return True
	return False
s = input()
if palindrome(s):
	if len(s) % 2 == 1:
		print('YES')
	else:
		print('NO')
else:
	l = len(s)
	for i in range(l // 2):
		if s[i] != s[l - 1 - i]:
			if palindrome(s[i + 1:l - 1 - i - 1 + 1]):
				print('YES')
				break
			else:
				print('NO')
				break


givenString = input()
reversedGivenString = reversed(givenString)
mismatch = 0
for (i, j) in zip(givenString, reversedGivenString):
	if i != j:
		mismatch += 1
if mismatch == 2 or (mismatch == 0 and len(givenString) % 2 != 0):
	print('YES')
else:
	print('NO')


x = input()
d = sum([i != j for (i, j) in zip(x, x[::-1])])
print('YES' if d == 2 or (d == 0 and len(x) % 2) else 'NO')


s = input()
l = len(s)
if l % 2 == 0:
	first_sub = s[0:l // 2]
	second_sub = s[l // 2:]
	second_sub = second_sub[::-1]
	mistakes = 0
	for i in range(len(first_sub)):
		if first_sub[i] != second_sub[i]:
			mistakes += 1
	if mistakes == 1:
		print('YES')
	else:
		print('NO')
else:
	first_sub = s[0:l // 2]
	second_sub = s[l // 2 + 1:]
	second_sub = second_sub[::-1]
	mistakes = 0
	for i in range(len(first_sub)):
		if first_sub[i] != second_sub[i]:
			mistakes += 1
	if mistakes <= 1:
		print('YES')
	else:
		print('NO')


s = input()
n = len(s) // 2
a = s[:n]
b = s[::-1][:n]
foo = 0
for i in range(n):
	if a[i] != b[i]:
		if foo == 0:
			foo = 1
		else:
			print('NO')
			break
else:
	if foo == 1 or len(s) % 2 == 1:
		print('YES')
	else:
		print('NO')


string = input().rstrip()
size = len(string)
firstHalf = string[:size // 2]
secondHalf = string[-1:-size // 2 - 1:-1]
diff = 0
for i in range(size // 2):
	if firstHalf[i] != secondHalf[i]:
		diff += 1
if diff == 1 or size == 1 or (diff == 0 and size % 2 != 0):
	print('YES')
else:
	print('NO')


x = input()
d = x[::-1]
l = 0
for n in range(len(x)):
	if x[n] != d[n]:
		l += 1
if l == 2:
	print('YES')
elif l == 0:
	if len(x) % 2 == 1:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


import math

def inp_n():
	return int(input())

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

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

def is_odd(n):
	if n & 1:
		return True
	return False
s = input()
c = 0
n = len(s)
for i in range(n // 2):
	if s[i] != s[n - i - 1]:
		c += 1
if c == 1:
	print('YES')
elif c == 0 and is_odd(n):
	print('YES')
else:
	print('NO')


s = input()
diff = 0
for index in range(0, len(s)):
	diff += 0 if s[index] == s[-1 - index] else 1
result = 'YES' if diff == 0 and len(s) % 2 == 1 or diff == 2 else 'NO'
print(result)


S = input()
N = len(S)
cnt = 0
for i in range(N // 2):
	if S[i] != S[N - 1 - i]:
		cnt += 1
if N % 2 == 0:
	if cnt == 1:
		print('YES')
	else:
		print('NO')
elif cnt == 0 or cnt == 1:
	print('YES')
else:
	print('NO')


s = input()
miss = 0
end = False
if len(s) == 1:
	print('YES')
	end = True
elif len(s) % 2 == 0:
	for el in range(int(len(s) / 2)):
		if s[el] != s[len(s) - 1 - el]:
			miss = miss + 1
else:
	for el in range(int(len(s) / 2)):
		if s[el] != s[len(s) - 1 - el]:
			miss = miss + 1
	if miss == 0:
		miss = 1
if miss == 1 and (not end):
	print('YES')
elif not end:
	print('NO')


import sys, os
from math import sqrt, gcd, ceil, log, floor, sin, pi
from math import factorial as fact
from bisect import bisect, bisect_left
from collections import defaultdict, Counter, deque
from heapq import heapify, heappush, heappop
from itertools import permutations
input = sys.stdin.readline
read = lambda : list(map(int, input().strip().split()))
MOD = 10 ** 9 + 7

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

def main():
	s = input().strip()
	for i in range(len(s)):
		for j in range(97, 123):
			if ord(s[i]) != j and pal(s[:i] + chr(j) + s[i + 1:]):
				print('YES')
				return
	print('NO')
main()


n = input()
x1 = n[0:len(n) // 2]
x2 = n[len(n) // 2:]
x2 = x2[::-1]
if len(n) % 2 == 0:
	c = 0
	for i in range(len(x1)):
		if x1[i] != x2[i]:
			c += 1
	if c == 1:
		print('YES')
		exit()
else:
	c = 0
	for i in range(len(x1)):
		if x1[i] != x2[i]:
			c += 1
	if c == 1 or c == 0:
		print('YES')
		exit()
print('NO')


from sys import exit
s = input()
if len(s) == 1:
	print('YES')
	exit(0)
for i in range(len(s)):
	st = ord('a')
	nd = ord('z')
	for j in range(st, nd + 1):
		if chr(j) == s[i]:
			continue
		curs = s[:i] + chr(j) + s[i + 1:]
		if curs == curs[::-1]:
			print('YES')
			exit(0)
print('NO')


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


A = ''
for c in input():
	if ord(c.upper()) > 64 and ord(c.upper()) < 91 or (ord(c) > 47 and ord(c) < 58):
		A = A + c.upper()
L = len(A)
U = A
R = A
for i in range(L // 2):
	if A[i] != A[L - i - 1]:
		U = A[0:i] + A[i + 1:]
		R = A[0:i] + A[L - i - 1] + A[i + 1:]
		break
if R == R[::-1] and R != A or (len(A) % 2 == 1 and R == A):
	print('YES')
else:
	print('NO')


inp = input()
revInp = inp[:int(len(inp) / 2 - 1):-1]
print('YES') if len([i for i in range(len(revInp)) if inp[i] != revInp[i]]) == 1 or (inp == inp[::-1] and len(inp) % 2) else print('NO')


from math import floor
s = input()
sl = len(s)
mid = len(s) / 2
mid_h = floor(mid)
diff = 0
for i in range(mid_h):
	if s[i] != s[sl - 1 - i]:
		diff += 1
if diff == 1:
	print('YES')
elif diff == 0 and mid != mid_h:
	print('YES')
else:
	print('NO')


s = input()
n = len(s)
res = 0
for i in range(n // 2):
	if s[i] != s[n - i - 1]:
		res = res + 1
if n & 1:
	print('YES' if res <= 1 else 'NO')
else:
	print('YES' if res == 1 else 'NO')


s = input()
if len(s) == 1:
	print('YES')
elif len(s) % 2 == 0:
	h = 0
	a = 0
	b = len(s) - 1
	while True:
		if s[a] != s[b]:
			h += 1
		a += 1
		b -= 1
		if b == len(s) // 2 - 1:
			break
	if h == 1:
		print('YES')
	else:
		print('NO')
else:
	h = 0
	a = 0
	b = len(s) - 1
	while True:
		if s[a] != s[b]:
			h += 1
		a += 1
		b -= 1
		if a == (len(s) + 1) // 2 - 1:
			break
	if h == 1 or h == 0:
		print('YES')
	else:
		print('NO')


S = input()
n = len(S)
cnt = 0
for i in range(n // 2):
	if S[i] != S[-1 - i]:
		cnt += 1
print('YES' if cnt == 1 or (cnt == 0 and n & 1) else 'NO')


s = input()
L = len(s)
l = L - 1
x = 0
i = 0
while i < l:
	if s[l] != s[i]:
		x += 1
	i += 1
	l -= 1
if x > 1:
	print('NO')
elif x == 0 and L % 2 == 0:
	print('NO')
else:
	print('YES')


s = input()
flag = False
for i in range(len(s)):
	for c in 'qwertyuiopasdfghjklzxcvbnm':
		if c == s[i]:
			continue
		t = s[:i] + c + s[i + 1:]
		if t == t[::-1]:
			print('YES')
			break
	else:
		continue
	break
else:
	print('NO')


S = input()
S1 = S[:len(S) // 2]
S2 = S[len(S) // 2:]
if len(S) % 2 == 0:
	S2 = S[len(S) // 2:]
else:
	S2 = S[len(S) // 2 + 1:]
k = 0
S2 = S2[::-1]
for i in range(len(S1)):
	if S1[i] != S2[i]:
		k = k + 1
if k > 1 or (k == 0 and len(S) % 2 == 0):
	print('NO')
	exit()
if k == 0 and len(S) % 2 != 0:
	print('YES')
if k == 1:
	print('YES')


s = input()
A = []
for i in s:
	A.append(i)
count = 0
a = 0
for j in range(0, int(len(A) / 2)):
	if A[j] != A[len(A) - 1 - j]:
		count = count + 1
		if count > 1:
			a = 1
			break
if a == 0:
	if count == 1:
		print('YES')
	elif count == 0 and len(A) % 2 != 0:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


def palindrom(s):
	count = 0
	n = len(s)
	for i in range(0, len(s) // 2):
		if s[i] != s[n - 1]:
			count += 1
		n -= 1
	if count == 1 or (count == 0 and len(s) % 2 == 1):
		return 'YES'
	return 'NO'
print(palindrom(input()))


s = input().strip()
n = len(s)
a = s[:n // 2]
b = s[n - n // 2:][::-1]
dif = sum((ai != bi for (ai, bi) in zip(a, b)))
print('YES' if dif == 1 or (dif == 0 and n & 1) else 'NO')


s = input()
c = 0
for x in range(len(s) // 2):
	if s[x] != s[len(s) - 1 - x]:
		c += 1
if len(s) % 2 == 0:
	print('YES' if c == 1 else 'NO')
else:
	print('YES' if c <= 1 else 'NO')


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


from sys import stdin
s = stdin.readline().rstrip()
c = 0
for i in range(len(s) // 2):
	if s[i] != s[len(s) - i - 1]:
		c += 1
if c == 1 or (len(s) % 2 == 1 and c == 0):
	print('YES')
else:
	print('NO')


l = input()
l = list(l)
flag = 0
counter = 0
for i in range(len(l) // 2):
	if l[i] != l[len(l) - i - 1]:
		counter += 1
	if counter > 1:
		print('NO')
		flag = 1
		break
if flag == 0 and counter == 1:
	print('YES')
elif counter == 0 and len(l) % 2 != 0:
	print('YES')
elif counter == 0:
	print('NO')


from sys import stdin
inFile = stdin
tokens = []
tokens_next = 0

def next_str():
	global tokens, tokens_next
	while tokens_next >= len(tokens):
		tokens = inFile.readline().split()
		tokens_next = 0
	tokens_next += 1
	return tokens[tokens_next - 1]

def nextInt():
	return int(next_str())
s = next_str()
c = 0
for i in range(len(s)):
	if i >= len(s) - 1 - i:
		break
	if s[i] != s[len(s) - 1 - i]:
		c += 1
if c != 1:
	if len(s) % 2 != 0 and s == ''.join(list(reversed(s))):
		c = 1
print('YES' if c == 1 else 'NO')


x = input()
y = 0
for i in range(len(x)):
	if x[i] == x[-i - 1]:
		continue
	elif y < 3:
		y += 1
	else:
		break
if y == 2 or (y == 0 and len(x) % 2):
	print('YES')
else:
	print('NO')


s = input()
n = len(s)
count = 0
for i in range(n // 2):
	if s[i] != s[n - 1 - i]:
		count += 1
		if count > 1:
			print('NO')
			quit()
if count == 1:
	print('YES')
	quit()
elif count == 0 and n % 2 == 1:
	print('YES')
elif count == 0 and n % 2 == 0:
	print('NO')
else:
	print('WTF')


s = input().strip()
l = len(s)
changes = 0
for i in range(int(l / 2 + 0.5)):
	if s[i] != s[~i]:
		changes += 1
		if changes > 1:
			print('NO')
			break
else:
	if l % 2 and (not changes) or changes == 1:
		print('YES')
	else:
		print('NO')


def pal():
	S = input()
	count = 0
	if len(S) % 2 == 0:
		mid = int(len(S) / 2)
		l1 = list(S[0:mid])
		l1.reverse()
		l2 = list(S[mid:])
		for i in range(mid):
			if not l1[i] == l2[i]:
				count = count + 1
	else:
		mid = int(len(S) / 2)
		l1 = list(S[0:mid])
		l1.reverse()
		l2 = list(S[mid + 1:])
		for i in range(mid):
			if not l1[i] == l2[i]:
				count = count + 1
	if count == 1:
		print('YES')
	elif count == 0:
		if len(S) % 2 == 0:
			print('NO')
		else:
			print('YES')
	else:
		print('NO')
pal()


s = input()
rs = s[::-1]
cnt = 0
for i in range(len(s) // 2):
	if s[i] != rs[i]:
		cnt += 1
	if cnt > 1:
		break
print('NYOE S'[cnt == 1 or (len(s) & 1 and (not cnt))::2])


a = input()
b = a[::-1]
c = 0
for i in range(len(a)):
	if a[i] is not b[i]:
		c += 1
if c is 2:
	print('YES')
elif c is 0 and len(a) % 2 is 1:
	print('YES')
else:
	print('NO')


word = input()
first_half = word[:len(word) // 2]
second_half = word[len(word) // 2:]

def un_matched(first_half, second_half):
	return len([i for i in range(len(word) // 2) if first_half[i] != second_half[i]])
if len(word) % 2 != 0 and un_matched(first_half, second_half[1:][::-1]) <= 1:
	print('YES')
elif len(word) % 2 == 0 and un_matched(first_half, second_half[::-1]) == 1:
	print('YES')
else:
	print('NO')


s = input()

def pal(s):
	a = ''
	for i in range(len(s) - 1, -1, -1):
		a += s[i]
	return a

def iss(s, func):
	index = 0
	for i in range(len(s)):
		if s[i] != func(s)[i]:
			index += 1
	if index == 2:
		return True
	elif index == 0 and len(s) % 2 == 1:
		return True
	else:
		return False
if iss(s, pal):
	print('YES')
else:
	print('NO')


n = input()
q = [0] * len(n)
b = n
p = ''
y = 0
l = 0
for i in range(len(n) - 1, -1, -1):
	p += n[i]
y = len(n) - 1
for i in range(len(n) // 2):
	if b[i] != b[y]:
		l += 1
	y -= 1
if l == 1 or (p == b and len(n) % 2 != 0):
	print('YES')
else:
	print('NO')


s = input()
l = [s[i] == s[-i - 1] for i in range(len(s) // 2)]
print('YES' if l.count(False) == 1 or (all(l) and len(s) % 2 == 1) else 'NO')


li = input()
b = len(li) // 2
count = 0
for i in range(b):
	if li[i] != li[-(i + 1)]:
		count += 1
if count == 1:
	print('YES')
elif count == 0 and len(li) & 1:
	print('YES')
else:
	print('NO')


import math
s = input()
p = 0
for num in range(math.ceil(len(s) / 2)):
	if s[num] != s[-(num + 1)]:
		p += 1
		if p > 1:
			print('NO')
			break
else:
	if p == 0:
		if len(s) % 2 == 0:
			print('NO')
		else:
			print('YES')
	else:
		print('YES')


a = input()
length = len(a)
pal = 0
counter = 0
for i in range(int(length / 2)):
	if a[i] == a[length - i - 1]:
		pal += 1
	else:
		counter += 1
if counter == 1:
	print('YES')
elif counter == 0:
	if length % 2 == 0:
		print('NO')
	else:
		print('YES')
else:
	print('NO')


import math
palin = list(input())

def ispal(t):
	r = math.floor(len(t) / 2)
	for i in range(r):
		if t[i] != t[-i - 1]:
			return False
	return True

def viab(t):
	count = 0
	r = math.floor(len(t) / 2)
	for i in range(r):
		if t[i] != t[-i - 1]:
			count += 1
	return count
if ispal(palin) == True and len(palin) % 2 == 0:
	print('NO')
elif ispal(palin) == True:
	print('YES')
elif viab(palin) == 1:
	print('YES')
else:
	print('NO')


import string
flag = False
s = input().strip()
v = list(string.ascii_lowercase)
if len(s) <= 15 or len(s) >= 1:
	for k in range(len(s)):
		for m in v:
			if k == 0 and m != s[0]:
				t = m + s[1:]
				if t == t[::-1]:
					flag = True
			if k == len(s) - 1 and m != s[len(s) - 1]:
				t = s[0:len(s) - 1] + m
				if t == t[::-1]:
					flag = True
			elif m != s[k]:
				t = s[:k] + m + s[k + 1:]
				if t == t[::-1]:
					flag = True
		if flag == True:
			print('YES')
			break
if flag == False:
	print('NO')


a = input()
a = list(a)
k = list(a)
a.reverse()
c = 0
for i in range(0, len(a)):
	if k[i] != a[i]:
		c += 1
	if c > 2:
		print('NO')
		break
if c == 2:
	print('YES')
if c == 0 and len(a) % 2 != 0:
	print('YES')
if c == 0 and len(a) % 2 == 0:
	print('NO')


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


def solve():
	s = input()
	mid = len(s) // 2
	diff = 0
	for (c1, c2) in zip(s[:mid], list(reversed(s))[:mid]):
		diff += int(c1 != c2)
	if diff == 1 or (diff == 0 and len(s) % 2 == 1):
		print('YES')
	else:
		print('NO')
solve()


a = list(input())
for i in range(len(a)):
	for j in range(26):
		tmp = a[i]
		a[i] = chr(97 + j)
		if tmp != a[i] and a == a[::-1]:
			print('YES')
			exit(0)
		a[i] = tmp
print('NO')


s = input()
l = len(s) // 2
r = sum((x == y for (x, y) in zip(s[:l], s[-l:][::-1])))
if r == l and len(s) % 2:
	print('YES')
else:
	print(('NO', 'YES')[l - r == 1])


__author__ = 'Alexander'

def Task(s):
	res = 0
	for i in range(int(len(s) / 2)):
		if s[i] != s[-i - 1]:
			res += 1
	if res == 1:
		answer = 'YES'
	elif res == 0 and len(s) % 2 == 1:
		answer = 'YES'
	else:
		answer = 'NO'
	return answer

def Main():
	inp = input()
	outp = Task(inp)
	print(outp)

def Test():
	assert Task('abccaa') == 'YES'
	assert Task('abbcca') == 'NO'
	assert Task('abcda') == 'YES'
Main()


from sys import stdin
from collections import defaultdict
input = lambda : stdin.readline().strip()
s = input()
n = len(s)
nd = 0
for i in range(0, n // 2):
	if s[i] != s[n - (i + 1)]:
		nd += 1
if n % 2 != 0 and nd <= 1:
	print('YES')
elif n % 2 == 0 and nd == 1:
	print('YES')
else:
	print('NO')


l = list(str(input()))
i = 0
j = len(l) - 1
cnt = 0
ans = 0
if len(l) % 2 == 1:
	while i < len(l) // 2 and j > len(l) // 2:
		if l[i] == l[j]:
			cnt += 0
		else:
			cnt += 1
		i += 1
		j -= 1
	if cnt > 1:
		print('NO')
	else:
		print('YES')
else:
	while i <= len(l) // 2 and j >= len(l) // 2:
		if l[i] == l[j]:
			cnt += 0
		else:
			cnt += 1
		i += 1
		j -= 1
	if cnt == 1:
		print('YES')
	else:
		print('NO')


x = input()
l1 = x[:len(x) // 2]
if len(x) % 2 == 1:
	l2 = x[len(x) // 2 + 1:]
else:
	l2 = x[len(x) // 2:]
c = 0
for a in range(len(l1)):
	if l1[a] != l2[len(l1) - a - 1]:
		c += 1
if c > 1:
	print('NO')
elif c == 0 and len(x) % 2 == 0:
	print('NO')
else:
	print('YES')


n = input()
count = 0
for i in range(len(n) // 2):
	if n[i] != n[-i - 1]:
		count += 1
	if count == 2:
		break
if count == 1:
	print('YES')
elif count == 0 and len(n) % 2 != 0:
	print('YES')
else:
	print('NO')


def main():
	from sys import stdin, stdout
	ip = stdin.readline().strip()
	count = len(ip)
	counter = 0
	for i in range(count // 2):
		if ip[i] != ip[count - i - 1]:
			counter += 1
	if counter == 1:
		stdout.write('YES')
	elif counter == 0:
		if count & 1:
			stdout.write('YES')
		else:
			stdout.write('NO')
	else:
		stdout.write('NO')
main()


a = input()
b = []
for i in a:
	b.append('*')
	b.append(i)
b.append('*')
k = len(b)
d = 0
for i in range(k):
	if b[i] != b[k - 1 - i]:
		d += 1
if len(a) % 2 == 0 and d == 0 or d > 2:
	print('NO')
else:
	print('YES')


a = input()
(i, j, c) = (0, len(a) - 1, 0)
while i < j:
	c += a[i] != a[j]
	i += 1
	j -= 1
print(('NO', 'YES')[c == 1 or (c == 0 and len(a) % 2)])


s = input()
h = int(len(s) / 2)
s1 = s[0:h:1]
s2 = s[-1:-(h + 1):-1]
count = 0
for i in range(h):
	if s1[i] != s2[i]:
		count += 1
if count == 1:
	print('YES')
elif count == 0:
	if len(s) % 2 != 0:
		print('YES')
	elif len(s) % 2 == 0:
		print('NO')
else:
	print('NO')


s = input()
l = len(s)
fault = 0
for i in range(l):
	if s[i] != s[l - 1 - i]:
		fault += 1
if fault == 0 and l % 2 == 1 or fault == 2:
	print('YES')
else:
	print('NO')


import math
a = input()
cnt = 0
c = -1
for i in range(math.ceil(len(a) // 2)):
	if a[i] != a[c]:
		cnt = cnt + 1
	c = c - 1
if cnt == 1:
	print('YES')
elif cnt == 0 and len(a) % 2 == 1:
	print('YES')
else:
	print('NO')


s1 = input()
s2 = s1[::-1]
n = int(len(s1))
cnt = 0
for i in range(int(n / 2)):
	if s1[i] != s2[i]:
		cnt += 1
print('YES' if cnt == 1 or (cnt == 0 and n % 2 == 1) else 'NO')


s = input()
len = len(s)
i = 0
j = len - 1
tmp = 0
while i <= j:
	if s[i] != s[j]:
		tmp += 1
		if tmp > 2:
			break
	i += 1
	j -= 1
if tmp == 1 or (tmp == 0 and len % 2 == 1):
	print('YES')
else:
	print('NO')


def solve(s):
	if s == ''.join(reversed(s)):
		if len(s) % 2 == 0:
			return 'NO'
		return 'YES'
	for i in range(len(s)):
		res = list(s)
		if s[i] != s[len(s) - i - 1]:
			res[i] = s[len(s) - i - 1]
			if ''.join(res) == ''.join(reversed(res)):
				return 'YES'
	return 'NO'

def main():
	s = input()
	print(solve(s))
main()


from sys import maxsize, stdout, stdin, stderr
import re
tup = lambda : map(int, stdin.readline().split())
I = lambda : int(stdin.readline())
lint = lambda : [int(x) for x in stdin.readline().split()]
S = lambda : stdin.readline().replace('\n', '').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)
stpr = lambda x: stdout.write(f'{x}' + '\n')
star = lambda x: print(' '.join(map(str, x)))
from math import ceil
from itertools import permutations
s = S()
n = len(s)
cnt = 0
for i in range(n // 2):
	if s[i] == s[n - i - 1]:
		pass
	else:
		cnt += 1
if cnt == 1 or (n % 2 == 1 and cnt == 0):
	print('YES')
else:
	print('NO')


s = input()
sch = 0
if len(s) % 2 == 0:
	a1 = s[:len(s) // 2]
	a2 = s[len(s) // 2:]
else:
	a1 = s[:len(s) // 2]
	a2 = s[len(s) // 2 + 1:]
for i in range(1, len(a1) + 1):
	if a1[i - 1] != a2[-i]:
		sch += 1
if sch == 1:
	print('YES')
elif sch == 0 and len(s) % 2 == 1:
	print('YES')
else:
	print('NO')


import sys

def validate(string):
	mismatches = 0
	for i in range(len(string) // 2):
		if string[i] != string[len(string) - 1 - i]:
			mismatches += 1
	return mismatches == 1 or (mismatches == 0 and len(string) % 2 == 1)
string = input()
if validate(string):
	print('YES')
else:
	print('NO')


word = input()
num_of_distinct_chr = 0
flag = False
for i in range(len(word) // 2):
	if word[i] != word[-(i + 1)]:
		num_of_distinct_chr += 1
		if num_of_distinct_chr > 1:
			flag = True
			break
if flag or (num_of_distinct_chr == 0 and len(word) % 2 == 0):
	print('NO')
else:
	print('YES')


alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
string = input()
n = len(string)
results = 'NO'
for x in range(n):
	for y in alphabet:
		temp = list(string)
		a = temp[x]
		temp[x] = y
		if temp[::-1] == temp and a != y:
			results = 'YES'
			break
	if results == 'YES':
		break
print(results)


n = [i for i in input()]
done = False
if len(n) % 2 == 0:
	if n == n[::-1]:
		print('NO')
		import sys
		sys.exit()
while True:
	if n == [] or len(n) == 1:
		print('YES')
		break
	if n[0] == n[-1]:
		n.pop(0)
		n.pop(-1)
		continue
	elif n[0] != n[-1] and done == False:
		n.pop(0)
		n.pop(-1)
		done = True
		continue
	elif n[0] != n[-1] and done == True:
		print('NO')
		break


s = str(input())
b = ''.join(reversed(s))
l = int(len(b) / 2)
sum = 0
for i in range(0, l, 1):
	if s[i] != b[i]:
		sum += 1
if sum == 1 or (sum == 0 and len(s) % 2 == 1):
	print('YES')
else:
	print('NO')


countmeow = 0
a = list(input())
b = list(reversed(a))
for i in range(len(a)):
	if a[i] != b[i]:
		countmeow = countmeow + 1
if countmeow == 0 and len(a) % 2 != 0:
	print('YES')
elif countmeow == 2:
	print('YES')
else:
	print('NO')


import sys
sys.setrecursionlimit(10 ** 9)
ll = lambda : map(int, input().split())
t = lambda : int(input())
ss = lambda : input()
lx = lambda x: map(int, input().split(x))
yy = lambda : print('YES')
nn = lambda : print('NO')
mod = 10 ** 9 + 7

def f():
	s = ss()
	n = len(s)
	fl = 0
	for i in range(n // 2):
		if s[i] != s[n - i - 1]:
			fl += 1
	if fl == 1:
		print('YES')
	elif fl == 0:
		if n % 2:
			yy()
		else:
			nn()
	else:
		nn()
f()


s = input()
l = len(s)
c = 0
if l % 2 == 0:
	x = s[:int(l / 2)]
	y = s[int(l / 2):]
	y = y[::-1]
else:
	x = s[:int(l / 2)]
	y = s[int(l / 2) + 1:]
	y = y[::-1]
for i in range(int(l / 2)):
	if x[i] != y[i]:
		c += 1
if l % 2 != 0 and s == s[::-1]:
	print('YES')
elif c == 1:
	print('YES')
else:
	print('NO')


import sys
s = list(input())
if s == s[::-1] and len(s) % 2 == 0:
	print('NO')
	sys.exit()
for i in range(len(s)):
	for c in set(s):
		a = s[i]
		s[i] = c
		if s == s[::-1]:
			print('YES')
			sys.exit()
		s[i] = a
print('NO')


string = input()
razl = 0
for i in range(len(string) // 2):
	if string[i] != string[-i - 1]:
		razl += 1
if razl > 1:
	print('NO')
elif razl == 1:
	print('YES')
elif len(string) % 2 == 1:
	print('YES')
else:
	print('NO')


print('YES' if (lambda a: (sum([int(x != y) for (x, y) in zip(a, a[::-1])]) == 2) | (a == a[::-1] and len(a) % 2))(input()) else 'NO')


s = input()
a = len(s)
diff = 0
ptr = 1
if a % 2 != 0:
	mid = a // 2
	for i in range(mid):
		if s[i] != s[a - i - 1]:
			diff = diff + 1
else:
	mid = a // 2
	for i in range(mid):
		if s[i] != s[a - i - 1]:
			diff = diff + 1
if diff == 1 or (diff == 0 and a % 2 != 0):
	print('YES')
else:
	print('NO')


from collections import defaultdict, Counter
from sys import stdin
YES = 'YES'
NO = 'NO'
S = stdin.readline().strip()

def solve(s):
	(l, r) = (0, len(s) - 1)
	changed = False
	sol = YES
	while True:
		if r < l:
			return YES if changed else NO
		if r == l:
			return YES
		if l < r:
			if s[l] != s[r]:
				if changed:
					return NO
				else:
					changed = True
		l += 1
		r -= 1
print(solve(S))


string = input()
length = len(string)
hf = string[:length // 2][::-1]
he = string[length // 2:]
if length % 2 != 0:
	he = he[1:]
count = sum((hf[i] != he[i] for i in range(len(he))))
if count == 1:
	print('YES')
elif count < 2 and length % 2 != 0:
	print('YES')
else:
	print('NO')


s = input()
l = len(s)
a = sum([s[i] != s[-(i + 1)] for i in range(l // 2)])
if a == 1:
	print('YES')
elif not a:
	if l % 2:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


s = input().strip()
c = 0
for i in range(len(s) // 2):
	if s[i] == s[-i - 1]:
		pass
	else:
		c += 1
	if c > 1:
		print('NO')
		exit()
if c == 1:
	print('YES')
else:
	if c == 0 and len(s) % 2 == 1:
		print('YES')
		exit()
	print('NO')


s = input()
z = s[::-1]
c = 0
for i in range(len(s)):
	if s[i] != z[i]:
		c += 1
c = c // 2
if c == 1 or (c == 0 and len(s) % 2 == 1):
	print('YES')
else:
	print('NO')


str = input()
ctr = 0
for i in range(0, len(str) // 2):
	if str[i] != str[len(str) - 1 - i]:
		ctr += 1
if len(str) % 2 != 0 and ctr <= 1 or (len(str) % 2 == 0 and ctr == 1):
	print('YES')
else:
	print('NO')


import sys

def solve():
	a = sys.stdin.readline()[:-1]
	l = len(a)
	c = 0
	for i in range(l // 2):
		if a[i] != a[l - i - 1]:
			c += 1
	print(['NO', 'YES'][c == 1 or (c == 0 and l % 2)])
solve()


s = input()
count = 0
i = 0
n = len(s) - 1
while i < (n + 1) / 2:
	if s[i] != s[n - i]:
		count += 1
		if count == 2:
			print('NO')
			exit()
	i += 1
if count == 0 and (n + 1) % 2 == 0:
	print('NO')
else:
	print('YES')


s = input()
n = len(s)
if n % 2:
	a = s[:n // 2]
	b = s[n // 2 + 1:]
	a = list(a)
	b = list(b)
	b.reverse()
	c = 1
	for i in range(n // 2):
		if a[i] != b[i]:
			c += 1
	if c > 2:
		print('NO')
	else:
		print('YES')
else:
	a = s[:n // 2]
	b = s[n // 2:]
	a = list(a)
	b = list(b)
	b.reverse()
	c = 0
	for i in range(n // 2):
		if a[i] != b[i]:
			c += 1
	if c != 1:
		print('NO')
	else:
		print('YES')


s = input()
n = len(s)
ok = False

def check(s):
	a = s
	b = s[::-1]
	return a == b
for i in range(n):
	for j in range(26):
		p = chr(j + ord('a'))
		x = s[:i] + p + s[i + 1:]
		if check(x):
			if x != s:
				ok = True
if ok:
	print('YES')
else:
	print('NO')


import sys

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

def ria():
	return list(map(int, sys.stdin.readline().split()))

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math
from collections import defaultdict
s = rs()
n = len(s)
j = n - 1
cnt = 0
for i in range(n // 2):
	if s[i] != s[j]:
		cnt += 1
	j -= 1
	if cnt > 1:
		break
if cnt == 1:
	ws('YES')
elif cnt == 0 and n % 2:
	ws('YES')
else:
	ws('NO')


n = input()
c = 0
for i in range(len(n) // 2):
	if n[i] != n[len(n) - 1 - i]:
		c += 1
if c == 0:
	if len(n) % 2 == 0:
		print('NO')
	else:
		print('YES')
elif c == 1:
	print('YES')
else:
	print('NO')


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


str = input()
index = int(len(str) / 2)
count = 0
for i in range(0, index):
	if not str[i] == str[-i - 1]:
		count += 1
if count == 1:
	print('YES')
elif count == 0 and len(str) % 2 == 1:
	print('YES')
else:
	print('NO')


from math import ceil, sqrt, floor
import sys
n = input()
err = 0
for (a, b) in zip(n, n[::-1]):
	if a != b:
		err += 1
print(['NO', 'YES'][err == 2 or (err == 0 and len(n) % 2)])


z = input()
m = len(z)
if z == z[::-1] and m % 2:
	print('YES')
elif z == z[::-1] and (not m % 2):
	print('NO')
else:
	r = 'YES'
	count = 0
	for i in range(0, m // 2):
		if z[i] != z[m - 1 - i]:
			count = count + 1
			if count > 1:
				r = 'NO'
				break
	print(r)


import sys, math
a = list(sys.stdin.readline())
a.pop()
left = []
right = []
for i in range(len(a) // 2):
	left.append(a[i])
	right.append(a[len(a) - i - 1])
k = 0
for i in range(len(left)):
	if left[i] != right[i]:
		k += 1
if len(a) % 2 == 0:
	if k == 1:
		print('YES')
	else:
		print('NO')
elif k <= 1:
	print('YES')
else:
	print('NO')


import sys
s = input()

def is_pal(s):
	return s == s[::-1]
for i in range(len(s)):
	for j in range(26):
		c = chr(ord('a') + j)
		if c == s[i]:
			continue
		new_s = s[:i] + c + s[i + 1:]
		if is_pal(new_s):
			print('YES')
			sys.exit(0)
print('NO')


st = input()
co = 0
for i in range(len(st) // 2):
	if st[i] != st[len(st) - 1 - i]:
		co += 1
if co > 1:
	print('NO')
elif co == 0 and len(st) % 2 == 0:
	print('NO')
else:
	print('YES')


def main(s):
	n = len(s)

	def pal(s):
		nonlocal n
		for i in range(0, n // 2 + 1):
			if s[i] != s[n - i - 1]:
				return False
		return True
	for i in range(n):
		for j in range(ord('a'), ord('z') + 1):
			if j != ord(s[i]):
				temp = s[i]
				s[i] = chr(j)
				if pal(s):
					return True
				s[i] = temp
	return False
print('YES' if main(list(input())) else 'NO')


def solve(s):
	cnt = 0
	l = 0
	r = len(s) - 1
	while l <= r:
		if s[l] != s[r]:
			cnt += 1
		if cnt >= 2:
			return False
		l += 1
		r -= 1
	if len(s) % 2 == 1:
		if cnt == 0 or cnt == 1:
			return True
	else:
		return cnt == 1
s = input()
if solve(s):
	print('YES')
else:
	print('NO')


s = input()
t = [s[i] for i in range(len(s) // 2) if s[i] != s[len(s) - i - 1]]
print(['NO', 'YES'][len(t) <= 1 and len(s) % 2 == 1 or len(t) == 1])


def is_palindrome(word: list):
	for index in range(int(len(word) / 2)):
		if word[index] != word[-(1 + index)]:
			return False
	return True

def change_letters_is_palindrome(word: list):
	if is_palindrome(word) and len(word) % 2 == 0:
		return False
	chars = set(word)
	for index in range(len(word)):
		possible_palindrome = word.copy()
		for char in chars:
			possible_palindrome[index] = char
			if is_palindrome(possible_palindrome):
				return True
	return False
word = list(input())
if change_letters_is_palindrome(word):
	print('YES')
else:
	print('NO')


x = input()
l = 0
c = 0
r = len(x) - 1
while l <= r:
	if x[l] != x[r]:
		c += 1
	l += 1
	r -= 1
if c == 1:
	print('YES')
elif c == 0 and len(x) % 2 == 1:
	print('YES')
else:
	print('NO')


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


from sys import exit
word = input().strip()
ct = 0
l = len(word)
for (a, b) in zip(word[:l // 2], word[-1:l // 2 - 1:-1]):
	if a != b:
		ct += 1
		if ct > 1:
			print('NO')
			exit()
if ct == 1 or l % 2:
	print('YES')
else:
	print('NO')


s = input()
l = len(s)
new = s[::-1]
i = 0
count = 0
while i < l:
	if new[i] != s[i]:
		count = count + 1
	i = i + 1
count = count // 2
if count == 1:
	print('Yes')
elif count > 1:
	print('No')
elif count == 0:
	if l % 2 == 0:
		print('NO')
	else:
		print('Yes')


def isPal(s):
	st = ''
	for i in range(len(s) - 1, -1, -1):
		st += s[i]
	if s == st:
		return True
	else:
		return False
s = input()
if isPal(s):
	if len(s) % 2 == 0:
		print('NO')
	else:
		print('YES')
else:
	for i in range(len(s)):
		if s[i] != s[len(s) - 1 - i]:
			ts = s[:len(s) - 1 - i]
			ts += s[i]
			ts += s[len(s) - i:]
			if isPal(ts):
				print('YES')
				break
			else:
				print('NO')
				break


s = input()
cnt = 0
low = 0
high = len(s) - 1
while low < high:
	if s[low] != s[high]:
		cnt += 1
	low += 1
	high -= 1
	pass
print('YES' if cnt == 1 or (cnt == 0 and len(s) % 2 != 0) else 'NO')


def main():
	s = input()
	n = len(s)
	change = False
	for i in range(n // 2):
		if s[i] != s[n - i - 1]:
			if change:
				print('NO')
				return
			else:
				change = True
	print('YES' if change or n % 2 != 0 else 'NO')
main()


def count_diff(s1):
	diff_count = 0
	for i in range(len(s1) // 2):
		if s1[i] != s1[-i - 1]:
			diff_count += 1
	return diff_count
s = input()
diff = count_diff(s)
if diff == 1 or (diff == 0 and len(s) % 2 == 1):
	print('YES')
else:
	print('NO')


s = str(input())
c = 0
for i in range(len(s)):
	l = i
	r = len(s) - i - 1
	if l < r and s[l] != s[r]:
		c += 1
print('YES' if c == 1 or (c == 0 and len(s) & 1) else 'NO')


from sys import stdin
s = input()
n = len(s)
cnt = 0
for i in range(n // 2):
	if s[i] != s[n - i - 1]:
		cnt += 1
if cnt == 1 or (cnt == 0 and n % 2):
	print('YES')
else:
	print('NO')


s = list(input())
t = s[::-1]
cnt = 0
for (a, b) in zip(s, t):
	if a != b:
		cnt += 1
if cnt == 2 or (cnt == 0 and len(s) % 2 == 1):
	print('YES')
else:
	print('NO')


a = str(input())
k = 0
l = 0
if len(a) % 2 == 0:
	s1 = a[:len(a) // 2]
	s2 = a[len(a) // 2:]
else:
	k = len(a) // 2
	s1 = a[:k]
	s2 = a[k + 1:]
s2 = s2[::-1]
for i in range(len(s1)):
	if s1[i] != s2[i]:
		l = l + 1
if l == 1:
	print('YES')
elif len(a) % 2 == 1 and l == 0:
	print('YES')
else:
	print('NO')


def main():
	string = input()
	if string == string[::-1] and len(string) % 2 != 0:
		return 'YES'
	for i in range(len(string) // 2 + 1):
		if string[i] != string[len(string) - 1 - i]:
			string = string[:i] + string[len(string) - 1 - i] + string[i + 1:]
			if string == string[::-1]:
				return 'YES'
			return 'NO'
	return 'NO'
answer = main()
print(answer)


import math
s = input()
(count, j) = (0, len(s) - 1)
for i in range(math.ceil(len(s) / 2)):
	if s[i] == s[j]:
		pass
	else:
		count += 1
	j -= 1
print('YES' if count == 1 or (count == 0 and len(s) % 2 != 0) else 'NO')


arr = input()
(size, i) = (0, 0)
if len(arr) % 2 == 1:
	while i < len(arr) / 2:
		if arr[i] != arr[len(arr) - i - 1]:
			size += 1
		i += 1
	if size <= 1:
		print('YES')
	else:
		print('NO')
else:
	while i < len(arr) / 2:
		if arr[i] != arr[len(arr) - i - 1]:
			size += 1
		i += 1
	if size == 1:
		print('YES')
	else:
		print('NO')


a = str(input(''))
length = len(a)
b = a[::-1]
count = 0
for i in range(length):
	if b[i] != a[i]:
		count = count + 1
if a == b and length % 2 == 1:
	print('YES')
	exit()
if count == 2:
	print('YES')
else:
	print('NO')


def ispal(s: str, pos: int, size: int):
	l = [x for x in s]
	if l[pos] == l[size - 1 - pos]:
		return False
	l[pos] = l[size - 1 - pos]
	if l == l[::-1]:
		return True
	else:
		return False
s = input()
n = len(s)
if s == s[::-1]:
	if n % 2 == 0:
		print('NO')
	else:
		print('YES')
	exit(0)
for i in range(n // 2):
	if ispal(s, i, n):
		print('YES')
		exit(0)
print('NO')


x = input()
y = x[::-1]
z = 0
for i in range(len(x)):
	if x[i] != y[i]:
		z += 1
if z > 2 or z == 0:
	if len(x) % 2 == 0:
		print('NO')
	elif z == 0:
		print('YES')
	else:
		print('NO')
else:
	print('YES')


b = 1
s = str(input())
org = s[:]
c = 'qazwsxedcrfvtgbyhnujmikolp'
rs = s[::-1]
if s == rs and len(s) % 2 == 0:
	print('NO')
	b = 0
if b:
	x = 0
	y = 0
	while 1:
		rs = s[::-1]
		if rs == s:
			print('YES')
			break
		s = s[:x] + c[y] + s[x + 1:]
		y += 1
		if y == 26:
			y = 0
			s = s[:x] + org[x] + s[x + 1:]
			x += 1
		if x == len(s):
			print('NO')
			break


n = input()

def f(n):
	t = n[:len(n) // 2]
	x = n[len(n) // 2:]
	x = x[::-1]
	cnt = 0
	for i in range(len(n) // 2):
		if t[i] != x[i]:
			cnt = cnt + 1
	if cnt == 1:
		print('YES')
	else:
		print('NO')
if len(n) % 2 != 0:
	if n == n[::-1]:
		print('YES')
	else:
		f(n)
elif n == n[::-1]:
	print('NO')
else:
	f(n)


x = list(input())
g = len(x)
p = g // 2
w = 0
if g % 2 == 0:
	q = x[:p] + x[:p][::-1]
elif x[::-1] == x and g % 2 != 0:
	print('YES')
	quit()
else:
	q = x[:p + 1] + x[:p][::-1]
for i in range(p, g):
	if x[i] != q[i - g]:
		w += 1
if w == 1:
	print('YES')
else:
	print('NO')


def ok(str1):
	count = 0
	for i in range(len(str1) // 2):
		if str1[i] != str1[len(str1) - i - 1]:
			count += 1
	if count <= 1 and len(str1) & 1 or count == 1:
		return True
	else:
		return False
str1 = input()
if ok(str1):
	print('YES')
else:
	print('NO')


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
ins = read_str()
diff = sum([a != b for (a, b) in zip(ins, ins[::-1])])
if diff == 2 or (diff == 0 and len(ins) % 2):
	print('YES')
else:
	print('NO')


s = input().strip()
ls = len(s)
if ls == 1:
	print('YES')
elif ls % 2 == 0:
	n = ls // 2
	nb = 0
	for i in range(n):
		if s[i] != s[ls - 1 - i]:
			nb += 1
	if nb == 1:
		print('YES')
	else:
		print('NO')
else:
	n = ls // 2
	nb = 0
	for i in range(n):
		if s[i] != s[ls - 1 - i]:
			nb += 1
	if nb <= 1:
		print('YES')
	else:
		print('NO')


s = input()
i = 0
j = len(s) - 1
b = 0
t = 0
if len(s) == 1:
	print('YES')
	exit()
s1 = s[0]
if len(s) % 2:
	if s[:j // 2] == s[j // 2 + 1:][::-1]:
		print('YES')
		exit()
while i < j:
	if s[i] != s[j]:
		b += 1
	if b > 1:
		print('NO')
		exit()
	i += 1
	j -= 1
print('YES') if b == 1 else print('NO')


S = input()
i = 0
j = len(S) - 1
qq = []
while i < j:
	if S[i] != S[j]:
		qq.append(i)
	i += 1
	j -= 1
if len(qq) == 0:
	if len(S) & 1:
		exit(print('YES'))
	else:
		exit(print('NO'))
if len(qq) == 1:
	exit(print('YES'))
print('NO')


l1 = list(input())
l2 = l1.copy()
l2.reverse()
diff = 0
ruined = 0
for x in range(len(l1)):
	if l1[x] != l2[x]:
		if diff == 0:
			diff = 1
		elif diff == 1:
			diff = 2
		else:
			ruined = 1
			break
if ruined or (diff != 2 and len(l1) % 2 == 0):
	print('NO')
else:
	print('YES')


n = list(input())
temp = ''.join(n)
le = len(n)
l = len(n) // 2
if temp == temp[::-1] and le % 2 == 0:
	print('NO')
	exit()
if temp == temp[::-1] and le % 2 != 0:
	print('YES')
	exit()
if le % 2 == 0:
	n1 = n[:l]
	n2 = n[l:][::-1]
	c = 0
	for i in list(zip(n1, n2)):
		i = list(i)
		if i[0] != i[1]:
			c = c + 1
		if c > 1:
			print('NO')
			exit()
	print('YES')
if le % 2 != 0:
	n1 = n[:l]
	n2 = n[l + 1:][::-1]
	c = 0
	for i in list(zip(n1, n2)):
		i = list(i)
		if i[0] != i[1]:
			c = c + 1
		if c > 1:
			print('NO')
			exit()
	print('YES')


s = input()
c = sum((a != b for (a, b) in zip(s, s[::-1])))
print('YES') if c == 2 or (c == 0 and len(s) % 2) else print('NO')


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


a = input()
l = int(len(a) / 2)
cnt = 0
if l != 0:
	for x in range(l):
		if a[x] != a[-x - 1]:
			cnt += 1
	if cnt == 1:
		print('YES')
	elif cnt == 0 and len(a) % 2 == 1:
		print('YES')
	else:
		print('NO')
else:
	print('YES')


a = input()
b = a[::-1]
print
l = len(a)
x = 0
for i in range(l):
	if a[i] == b[i]:
		continue
	else:
		x += 1
if x > 2:
	print('NO')
elif x == 0:
	if l % 2:
		print('YES')
	else:
		print('NO')
else:
	print('YES')


from sys import stdin, stdout
s = stdin.readline().strip()
if s == s[::-1] and (not len(s) % 2):
	stdout.write('NO')
else:
	cnt = 0
	for i in range(len(s)):
		if s[i] != s[-i - 1]:
			cnt += 1
	if cnt > 2:
		stdout.write('NO')
	else:
		stdout.write('YES')


from math import *
import sys
s = input()
mid = len(s) // 2
if len(s) % 2 == 0:
	l = s[0:mid]
	r = s[mid:]
	r = r[::-1]
else:
	l = s[0:mid]
	r = s[mid + 1:]
	r = r[::-1]
counter = 0
res = 'YES'
for i in range(len(l)):
	if l[i] != r[i]:
		counter += 1
		if counter == 2:
			res = 'NO'
			break
if counter == 0 and len(s) % 2 == 0:
	res = 'NO'
print(res)


q = input()
w = 0
s = 0
e = len(q) - 1
if len(q) % 2 == 0:
	v = len(q) // 2
else:
	v = len(q) // 2 + 1
for r in range(v):
	if q[w] != q[e]:
		s = s + 1
	e = e - 1
	w = w + 1
if s == 0:
	if len(q) % 2 != 0:
		s = s + 1
if s == 1:
	print('YES')
else:
	print('NO')


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


a = input()
long = len(a)
bool = 'NO'
cuo = 0
for i in range(long):
	if i >= long - 1 - i:
		if cuo == 0 and long % 2 == 0:
			break
		else:
			bool = 'YES'
		break
	if a[i] == a[long - i - 1]:
		continue
	elif cuo == 0:
		cuo += 1
		continue
	else:
		break
print(bool)


s = input()
l = len(s)
if l % 2:
	mid = int((l - 1) / 2)
	left = s[0:mid]
	right = s[mid + 1:]
else:
	split = int(l / 2)
	left = s[0:split]
	right = s[split:]
ans = 1 == sum([not a == b for (a, b) in zip(left, right[::-1])])
if s == s[::-1] and l % 2:
	ans = True
print(('NO', 'YES')[ans])


import os
import sys
import random
n = str(input())
ok = 0
for i in range(0, len(n) // 2):
	if n[i] != n[len(n) - i - 1] and ok == 0:
		ok = 1
	elif n[i] != n[len(n) - i - 1]:
		print('No')
		quit()
if ok == 0 and len(n) % 2 == 0:
	print('No')
	quit()
print('Yes')


s = input()
start = 0
end = len(s) - 1
cnt = 0
while start <= end:
	if s[start] != s[end]:
		cnt += 1
	start += 1
	end -= 1
if cnt == 1 or (len(s) % 2 == 1 and cnt == 0):
	print('YES')
else:
	print('NO')


s = input()
if len(s) == 1:
	print('YES')
else:
	l = list(s)
	l.reverse()
	t = ''.join(l)
	l = [0] * len(s)
	for i in range(len(s)):
		if s[i] != t[i]:
			l[i] = 1
	r = ''.join([str(i) for i in l])
	if r.count('1') == 2 or (r.count('1') == 0 and len(s) % 2 == 1):
		print('YES')
	else:
		print('NO')


s = input().strip()
l = len(s)
changes = 0
if l % 2 == 0:
	limit = int(l / 2)
	oddPass = False
else:
	limit = l // 2 + 1
	oddPass = True
for i in range(limit):
	if changes > 1:
		break
	start = s[i]
	end = s[l - 1 - i]
	if start != end:
		changes += 1
if changes == 1:
	print('YES')
elif changes == 0 and oddPass == True:
	print('YES')
else:
	print('NO')


from math import ceil

def check(a, b):
	distance = 0
	for i in range(len(a)):
		if a[i] != b[i]:
			distance += 1
	return distance
S = input()
a = S[:len(S) // 2]
b = S[ceil(len(S) / 2):]
b = b[::-1]
l = check(a, b)
if l == 1:
	print('YES')
elif l == 0:
	if len(S) % 2 == 1:
		print('YES')
	else:
		print('NO')
else:
	print('NO')


s = input()
j = len(s)
count = 0
for x in range(j // 2):
	if s[x] != s[j - 1 - x]:
		count += 1
if count == 1:
	print('YES')
elif count == 0 and j % 2 != 0:
	print('YES')
else:
	print('NO')


a = list(input())
(s1, s2) = (a[:len(a) // 2], a[len(a) // 2:])
if len(s2) > len(s1):
	s2 = s2[1:]
count = 0
for i in range(len(s1)):
	if s1[i] != s2[len(s2) - 1 - i]:
		count += 1
if count == 1:
	print('YES')
elif count == 0:
	print('YES' if len(a) % 2 != 0 else 'NO')
else:
	print('NO')


s = list(input())
l = len(s) - 1
changed = False
for i in range(len(s) // 2):
	if s[i] != s[l - i]:
		if changed:
			print('NO')
			exit()
		else:
			changed = True
if changed or len(s) % 2 == 1:
	print('YES')
else:
	print('NO')


s = input()
n = len(s)
x = len(s)
left = 0
right = x - 1
count = 0
while left < right:
	if s[left] != s[right]:
		count += 1
	if count > 1:
		print('NO')
		break
	left += 1
	right -= 1
if n % 2 != 0 and count <= 1:
	print('YES')
elif n % 2 == 0 and count == 1:
	print('YES')
elif n % 2 == 0 and count == 0:
	print('NO')


def result():
	check_string = input()
	counter = 0
	l = len(check_string)
	for i in range(len(check_string)):
		if i >= l / 2:
			break
		if check_string[i] == check_string[0 - (i + 1)]:
			continue
		else:
			counter += 1
	if counter == 0:
		if l % 2 == 0:
			print('NO')
		else:
			print('YES')
	elif counter != 1:
		print('NO')
	else:
		print('YES')
result()


s = input()
ls = len(s)
k = (ls >> 1) + (ls & 1)
cnt = 0
for i in range(k):
	if s[i] != s[ls - i - 1]:
		cnt += 1
if cnt < 2:
	if cnt == 1 or (not cnt and ls & 1):
		print('YES')
	else:
		print('NO')
else:
	print('NO')


s = input()
if len(s) == 1:
	print('YES')
	quit()
h = len(s) // 2
a = s[:h]
b = s[-h:]
d = 0
for i in range(h):
	if a[i] != b[-i - 1]:
		d += 1
if d == 1 or (len(s) % 2 == 1 and d == 0):
	print('YES')
else:
	print('NO')


s = input()
l = len(s) - 1
diff = 0
i = 0
while i <= l:
	diff += s[i] != s[l]
	i += 1
	l -= 1
print(('NO', 'YES')[diff == 1 or (diff == 0 and len(s) % 2 == 1)])


a = input()
b = ''
cnt = 0
for i in range(0, len(a)):
	if i <= (len(a) - 1) // 2:
		b += a[i]
	elif a[i] != a[len(a) - 1 - i]:
		cnt += 1
		b += a[len(a) - 1 - i]
	else:
		b += a[i]
if cnt > 1 or (cnt == 0 and len(a) % 2 == 0):
	print('NO')
else:
	print('YES')


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


s = input()
n = len(s)
i = 0
k = 0
while i < n // 2 and k < 2:
	if s[i] != s[n - i - 1]:
		k += 1
	i += 1
if k == 1 or (n % 2 == 1 and k == 0):
	print('YES')
else:
	print('NO')


s = input()
n = len(s)
diff = 0
for i in range(n // 2):
	if s[i] != s[n - 1 - i]:
		diff += 1
poss = diff == 1 or (diff == 0 and n % 2 == 1)
ans = 'YES' if poss else 'NO'
print(ans)


import sys
s = input().rstrip()
for i in range(len(s)):
	for j in range(26):
		if chr(j + ord('a')) == s[i]:
			continue
		s1 = s[:i] + chr(j + ord('a')) + s[i + 1:]
		if s1 == s1[::-1]:
			print('YES')
			sys.exit(0)
print('NO')


a = input()
b = a
a = list(a)
b = list(b)
a.reverse()
l = len(a)
count = 0
for i in range(0, l):
	if a[i] != b[i]:
		count += 1
if count == 2 or (count == 0 and l % 2 != 0):
	print('YES')
else:
	print('NO')


from math import ceil
a = list(input())
b1 = len(a) - 1
i = 0
a1 = 0
x = 0
while i < int(len(a) / 2):
	if x == 2:
		break
	else:
		z1 = a[a1]
		z2 = a[b1]
		if z1 != z2:
			x += 1
			a1 += 1
			b1 -= 1
		else:
			a1 += 1
			b1 -= 1
		i += 1
if len(a) % 2 == 0 and (x == 2 or x == 0):
	print('NO')
elif len(a) % 2 != 0 and x == 0:
	print('YES')
elif len(a) % 2 != 0 and x == 2:
	print('NO')
else:
	print('YES')


string = input()
reverse = string[::-1]
changes = 0
for (i, s) in enumerate(string):
	if string[i] != reverse[i]:
		changes += 1
if changes > 2 or (len(string) % 2 == 0 and changes == 0):
	print('NO')
else:
	print('YES')


st = [x for x in input()]
l = len(st)
flag = False
for i in range(l // 2):
	if st[i] != st[l - i - 1]:
		st[i] = st[l - i - 1]
		flag = True
		break
res = ''.join(st)
if l % 2 == 1 and res == res[::-1]:
	print('YES')
elif flag == True and l % 2 == 0 and (res == res[::-1]):
	print('YES')
else:
	print('NO')


from math import ceil
n = input()
ln = ceil(len(n) / 2)
f = 0
if n != n[::-1]:
	for i in range(0, ln):
		if n[i] != n[-(i + 1)]:
			if f == 0:
				f = 1
			else:
				print('NO')
				f = 0
				break
elif len(n) % 2 == 1:
	print('YES')
else:
	print('NO')
if f == 1:
	print('YES')


import sys
read = lambda : sys.stdin.readline().rstrip()
readi = lambda : int(sys.stdin.readline())
writeln = lambda x: sys.stdout.write(str(x) + '\n')
write = lambda x: sys.stdout.write(x)

def solve(s):
	l = len(s)
	if l == 1:
		return 'YES'
	cnt = 0
	for i in range(l // 2):
		if s[i] != s[l - 1 - i]:
			cnt += 1
	if cnt == 1:
		return 'YES'
	elif cnt == 0 and l % 2:
		return 'YES'
	else:
		return 'NO'
s = read()
writeln(solve(s))


s = input()
x = len(s)
ch = 0
i = 0
if x % 2 != 0:
	for i in range(int((x - 1) / 2)):
		if s[i] == s[x - i - 1]:
			ch = ch
		else:
			ch += 1
else:
	for i in range(int(x / 2)):
		if s[i] == s[x - i - 1]:
			ch = ch
		else:
			ch += 1
if x % 2 != 0:
	if ch == 0:
		ch = 1
if ch != 1:
	print('NO')
else:
	print('YES')


a = input()
qq = len(a)
cnt = 0
for i in range(0, qq // 2):
	if a[i] != a[qq - 1 - i]:
		cnt += 1
if qq % 2 == 1 and cnt == 0:
	cnt = 1
if cnt == 1:
	print('YES')
else:
	print('NO')


fread = input

def main():
	s = fread().strip()
	req = 0
	for i in range(len(s) // 2):
		if s[i] != s[-i - 1]:
			req += 1
	if req == 1 or (len(s) % 2 == 1 and req == 0):
		print('YES')
	else:
		print('NO')
main()


s = input()
n = len(s)
k = n - 1
c = 0
for i in range(n):
	if s[i] != s[k]:
		c += 1
	k -= 1
	if i == k or k - i == 1:
		break
if c == 0:
	c += n % 2
if c == 1:
	print('YES')
else:
	print('NO')


x = input()
count = 0
for i in range(len(x) // 2):
	count += x[i] != x[len(x) - i - 1] and 1 or 0
print((count == 1 and len(x) % 2 == 0 or (len(x) % 2 == 1 and count < 2)) and 'YES' or 'NO')


s = input()
(p, k) = (0, len(s) - 1)
zmiana = False
while p < k:
	if s[p] != s[k]:
		if zmiana:
			print('NO')
			exit()
		else:
			zmiana = True
	(p, k) = (p + 1, k - 1)
if zmiana or len(s) % 2 == 1:
	print('YES')
else:
	print('NO')


import sys
s = input()
n = len(s)
one = odd = 0
neg = 0
if n % 2 == 0:
	for i in range(n // 2):
		if s[i] != s[n - i - 1]:
			one += 1
else:
	odd = 1
	for i in range(n // 2):
		if s[i] != s[n - 1 - i]:
			one += 1
if one == 1 or (odd == 1 and one == 0):
	print('YES')
else:
	print('NO')


inp = input()
r_inp = inp[::-1]
cnt_diff = 0
for i in range(len(inp) // 2):
	a = inp[i]
	b = r_inp[i]
	if a != b:
		cnt_diff += 1
if cnt_diff == 0 and len(inp) % 2 == 1:
	print('YES')
elif cnt_diff == 1:
	print('YES')
else:
	print('NO')


l = list(input())
tom = len(l) // 2
la = len(l) - 1
s = 0
if tom % 2 == 0:
	for x in range(tom):
		if l[x] == l[la]:
			x += 1
			la -= 1
		else:
			la -= 1
			x += 1
			s += 1
else:
	for x in range(tom):
		if l[x] == l[la]:
			x += 1
			la -= 1
		else:
			x += 1
			la -= 1
			s += 1
if s == 0 and len(l) % 2 != 0:
	print('YES')
elif s == 1:
	print('YES')
else:
	print('NO')


s = [n for n in input()]
z = s[::-1]
l = 0
for n in range(len(s)):
	if s[n] != z[n]:
		l += 1
if l == 0:
	if len(s) % 2 == 1:
		print('YES')
	else:
		print('NO')
elif l > 2:
	print('NO')
elif l == 2:
	print('YES')


test = input()
n = len(test)
j = n - 1
mismatch = 0
for i in range(int(n / 2)):
	a = test[i]
	b = test[j]
	j -= 1
	if a != b:
		mismatch += 1
if mismatch > 1:
	print('NO')
elif mismatch == 1:
	print('YES')
elif n % 2 == 1:
	print('YES')
else:
	print('NO')


s = input()
c = sum((x != y for (x, y) in zip(s, s[::-1])))
print(('NO', 'YES')[c == 2 or (c == 0 and len(s) % 2)])


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
s = list(input())

def check(s):
	for i in range(len(s) // 2):
		if s[i] != s[len(s) - i - 1]:
			return False
	return True
for i in range(len(s)):
	v = s[i]
	for c in [chr(ord('a') + i) for i in range(26)]:
		if c == v:
			continue
		s[i] = c
		if check(s):
			print('YES')
			exit(0)
	s[i] = v
print('NO')


def main():
	s = input().strip()
	l = 0
	r = len(s) - 1
	num = 0
	while l < r:
		if s[l] != s[r]:
			num += 1
		l += 1
		r -= 1
	if num == 1 or (num == 0 and len(s) % 2 == 1):
		print('YES')
	else:
		print('NO')
main()


my_string = input()
reversed_string = my_string[::-1]
count = 0
for i in range(0, int(len(my_string))):
	if my_string[i] != reversed_string[i]:
		count = count + 1
if count == 2:
	print('YES')
elif count == 0 and len(my_string) % 2 == 1:
	print('YES')
else:
	print('NO')


import copy
s = list(input())
a = copy.copy(s)
a.reverse()
k = len(s)
total = 0
for i in range(0, k):
	if s[i] != a[i]:
		total = total + 1
	if total > 2:
		print('NO')
		break
if total == 2:
	print('YES')
elif total == 0 and k % 2 == 1:
	print('YES')
elif total < 2:
	print('NO')


string = input()
counter = 0
for i in range(len(string) // 2):
	l = i
	r = len(string) - i - 1
	counter += string[l] != string[r]
if counter == 1:
	print('YES')
elif counter == 0 and len(string) % 2:
	print('YES')
else:
	print('NO')


a = input()
b = list(a)
i = 0
d = len(b)
j = d + 1
k = 0
c = d // 2
z = a[::-1]
q = 0
if a == z:
	if d % 2 == 0:
		print('NO')
	else:
		print('YES')
else:
	while i != c:
		j = j - 2
		if b[i] != b[i + j]:
			k = k + 1
		i = i + 1
		q = q + 1
	if k == 1:
		print('YES')
	else:
		print('NO')


def main():
	s = input()
	n = len(s)
	l = 0
	r = n - 1
	cnt = 0
	while l <= r:
		if s[l] != s[r]:
			cnt += 1
		l += 1
		r -= 1
		if cnt > 1:
			print('NO')
			return
	if cnt == 1 or n % 2 == 1:
		print('YES')
	else:
		print('NO')
main()


s = input()
N = len(s)
i = 0
isChangePerformed = False
isPalindrome = True
while i < int(N / 2):
	if s[i] != s[N - i - 1]:
		if not isChangePerformed:
			isChangePerformed = True
		else:
			isPalindrome = False
	i += 1
if not isChangePerformed and N % 2 == 0:
	isPalindrome = False
print('YES' if isPalindrome else 'NO')


s = input()
n = len(s)
x = int(n / 2)
count = 0
if n % 2 != 0:
	for i in range(x):
		j = len(s) - i - 1
		if j < x:
			break
		elif s[i] != s[j]:
			count = count + 1
	if count <= 1:
		print('YES')
	else:
		print('NO')
else:
	for i in range(x):
		j = len(s) - i - 1
		if j < x:
			break
		elif s[i] != s[j]:
			count = count + 1
	if count == 1:
		print('YES')
	else:
		print('NO')


def isPalindrome(s):
	return s == s[::-1]

def solve():
	s = input()
	n = len(s)
	for i in range(n // 2 + n % 2):
		if i != n // 2 and s[i] == s[n - i - 1]:
			continue
		elif isPalindrome(s[:i] + s[i + 1:n - i - 1] + s[n - i:]):
			print('YES')
			return
	print('NO')
solve()


s = input()
n = int(len(s))
res = 0
m = n / 2
for i in range(0, int(len(s) / 2)):
	if s[i] != s[n - i - 1]:
		res = res + 1
if res <= 1 and n % 2 > 0 or (res == 1 and n % 2 == 0):
	print('YES')
else:
	print('NO')


s = input()
le = len(s)
cnt = 0
for i in range(int((le + 1) / 2)):
	if s[i] != s[le - i - 1]:
		cnt += 1
if cnt > 1:
	print('NO')
elif le % 2 == 1 and cnt == 0:
	print('YES')
elif cnt == 1:
	print('YES')
else:
	print('NO')


s = input()
n = len(s)
if n % 2:
	ss = s[:n // 2]
	tt = s[n // 2 + 1:][::-1]
	cnt = 0
	for i in range(n // 2):
		cnt += ss[i] != tt[i]
	if cnt <= 1:
		print('YES')
	else:
		print('NO')
else:
	ss = s[:n // 2]
	tt = s[n // 2:][::-1]
	cnt = 0
	for i in range(n // 2):
		cnt += ss[i] != tt[i]
	if cnt == 1:
		print('YES')
	else:
		print('NO')


s = input()
a = len(s)
if a % 2 == 0:
	a = a // 2
	s1 = s[:a]
	s2 = s[a:]
	res = 0
	for i in range(a):
		if s1[i] != s2[-i - 1]:
			res += 1
	if res == 1:
		print('YES')
	else:
		print('NO')
else:
	a = a // 2
	s1 = s[:a]
	s2 = s[a + 1:]
	res = 0
	for i in range(a):
		if s1[i] != s2[-i - 1]:
			res += 1
	if res == 1 or res == 0:
		print('YES')
	else:
		print('NO')


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


def f(s):
	a = s[:len(s) // 2]
	b = s[::-1][:len(s) // 2]
	diff = 0
	for i in range(len(s) // 2):
		if a[i] != b[i]:
			diff += 1
			if diff >= 2:
				return 'NO'
	if diff == 1:
		return 'YES'
	elif len(s) % 2 == 1:
		return 'YES'
	else:
		return 'NO'
s = input()
print(f(s))


a = input()
x = 0
h = ''
f = ''
g = ''
if len(a) % 2 != 0:
	a = a[0:len(a) // 2] + a[len(a) // 2 + 1:]
	f = a[0:len(a) // 2]
	g = a[len(a) // 2:]
	for i in range(1, len(g) + 1):
		h = h + g[-i]
	for i in range(len(h)):
		if h[i] != f[i]:
			x = x + 1
	if x == 0:
		x = x + 1
else:
	f = a[0:len(a) // 2]
	g = a[len(a) // 2:]
	for i in range(1, len(g) + 1):
		h = h + g[-i]
	for i in range(len(h)):
		if h[i] != f[i]:
			x = x + 1
if x == 1:
	print('YES')
else:
	print('NO')


def is_palindrome(string):
	return ''.join(reversed(string)) == string
str1 = input()
for (ind, ch) in enumerate(str1):
	for code in range(ord('a'), ord('z') + 1):
		new_ch = chr(code)
		if ch == new_ch:
			continue
		new_str = str1[:ind] + new_ch + str1[ind + 1:]
		if is_palindrome(str1[:ind] + new_ch + str1[ind + 1:]):
			print('YES')
			exit(0)
print('NO')


def pol2(s):
	k = 0
	for i in range(0, len(s) // 2 + 1):
		if s[i] != s[len(s) - 1 - i]:
			k += 1
	if k == 1:
		return 'YES'
	return 'NO'

def is_pal(s):
	return s == s[::-1]

def pol(s):
	for i in range(0, len(s)):
		for j in range(ord('a'), ord('z') + 1):
			c = chr(j)
			if s[i] != c:
				s1 = s[:i] + c + s[i + 1:]
				if is_pal(s1):
					return 'YES'
	return 'NO'
s = str(input())
print(pol(s))


s = input()
count = 0
for i in range(0, len(s) // 2):
	if s[i] == s[len(s) - 1 - i]:
		continue
	else:
		count += 1
if count <= 1:
	if count == 1:
		print('YES')
	elif count == 0:
		if len(s) % 2 != 0:
			print('YES')
		else:
			print('NO')
else:
	print('NO')


a = input()
l = []
c = 0
for i in range(len(a)):
	l.append(a[i])
n = len(a)
mid = len(a) // 2
for i in range(0, mid):
	if l[i] != l[n - i - 1]:
		c = c + 1
if c == 1:
	print('YES')
elif n % 2 != 0 and c == 0:
	print('YES')
else:
	print('NO')


s = input()
changed = False
for i in range(0, len(s) // 2):
	if s[i] != s[len(s) - i - 1]:
		if changed:
			print('NO')
			exit()
		else:
			changed = True
print('NO' if not changed and len(s) % 2 == 0 else 'YES')


S = str(input())
S1 = S[:len(S) // 2]
z = 0
if len(S) % 2 == 0:
	S2 = S[len(S) // 2:]
else:
	S2 = S[len(S) // 2 + 1:]
for i in range(len(S) // 2):
	if S1[i] == S2[len(S2) - 1 - i]:
		continue
	else:
		z += 1
if z == 1 or (z == 0 and len(S) % 2 == 1):
	print('YES')
else:
	print('NO')


s = input()
n = len(s) - 1
res = sum([1 if s[_] != s[n - _] else 0 for _ in range(0, n + 1)])
res //= 2
print('YES' if res == 1 or (res == 0 and n + 1 & 1) else 'NO')


s = input()
strr = list(s)
a = []
if len(s) == 1:
	print('YES')
strr1 = strr[0:len(s) // 2]
if len(s) % 2 == 0:
	strr2 = strr[len(s) // 2:len(s)]
elif len(s) != 1 and len(s) % 2 != 0:
	strr2 = strr[len(s) // 2 + 1:len(s)]
for i in range(len(strr1)):
	if strr1[i] == strr2[len(strr2) - i - 1]:
		a.append('*')
	else:
		a.append(i)
if len(s) != 1:
	a[:] = (value for value in a if value != '*')
	if len(a) == 1:
		print('YES')
	elif len(a) == 0 and len(s) % 2 != 0:
		print('YES')
	else:
		print('NO')


s = input()
flag = 1
mark = 0
pal = 0
for i in range(0, len(s)):
	if s[i] == s[len(s) - i - 1] and len(s) - i - 1 != i:
		continue
	else:
		pal = 1
		t = s[i]
		flag = 1
		for j in range(0, len(s)):
			if s[j] != s[len(s) - j - 1] and (j != i and j != len(s) - i - 1):
				flag = 0
				if flag and (not mark):
					print('YES')
					mark = 1
if not mark:
	if flag and pal:
		print('YES')
	else:
		print('NO')


a = input()
i = 0
ii = -1
kek = 0
if len(a) % 2 == 1:
	ser = len(a) // 2 + 1
else:
	ser = len(a) // 2
while i <= ser - 1:
	if a[i] != a[ii]:
		kek += 1
	i += 1
	ii -= 1
if kek == 1 or (kek == 0 and len(a) % 2 == 1):
	print('YES')
else:
	print('NO')


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

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

def si():
	return input()

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

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

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

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
import sys
input = sys.stdin.readline
scanner = lambda : int(input())
string = lambda : input().rstrip()
get_list = lambda : list(read())
read = lambda : map(int, input().split())
get_float = lambda : map(float, input().split())

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

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

def is_integer(n):
	return math.ceil(n) == math.floor(n)

def nCr(n, k):
	if k > n:
		return 0
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def phi(n):
	result = n
	p = 2
	while p * p <= n:
		if n % p == 0:
			while n % p == 0:
				n = n // p
			result = result * (1.0 - 1.0 / float(p))
		p = p + 1
	if n > 1:
		result = result * (1.0 - 1.0 / float(n))
	return int(result)

def is_prime(n):
	if n == 0:
		return False
	if n == 1:
		return True
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def next_prime(n, primes):
	while primes[n] != True:
		n += 1
	return n
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

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

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

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()

def binary_search(low, high, w, h, n):
	while low < high:
		mid = low + (high - low) // 2
		if check(mid, w, h, n):
			low = mid + 1
		else:
			high = mid
	return low

def check(beauty, s, n, count):
	pass
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
alphs = 'abcdefghijklmnopqrstuvwxyz'
from itertools import permutations
import math
import bisect as bis
import random
import sys
import collections as collect

def solve():
	s = string()
	c = 0
	for i in range(len(s) // 2):
		if s[i] != s[len(s) - i - 1]:
			c += 1
	if len(s) % 2 == 0:
		print(['NO', 'YES', 'NO'][min(2, c)])
		return
	print(['YES', 'YES', 'NO'][min(2, c)])
	return
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

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

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

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

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

class IOWrapper(IOBase):

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

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


s = input()
if len(s) % 2 == 0:
	l = len(s) // 2
	r = l
else:
	l = len(s) // 2
	r = 1 + 1
(l_s, r_s) = (s[:l], s[r:][::-1])
num = 0
for (i, c) in enumerate(l_s):
	if l_s[i] != r_s[i]:
		num += 1
if num > 1:
	print('NO')
elif len(s) % 2 == 0 and num == 0:
	print('NO')
else:
	print('YES')


import string
s = input()

def solve(s):
	for j in range(len(s)):
		for i in string.ascii_lowercase:
			S = s[:j] + i + s[j + 1:]
			if S == S[::-1] and s[j] != i:
				return 'YES'
	return 'NO'
print(solve(s))


def failed():
	print('NO')
	exit()

def passed():
	print('YES')
	exit()
word = input()
word = list(word)
ulta = list(word)
ulta.reverse()
n = len(word)
if n == 0:
	failed()
if n == 2:
	if word[0] == word[1]:
		failed()
	else:
		passed()
count = 0
for i in range(len(word) // 2):
	if word[i] != ulta[i]:
		count += 1
if n % 2 != 0:
	if count < 2:
		passed()
	else:
		failed()
elif count == 1:
	passed()
else:
	failed()


s = input()
l = len(s)
if l % 2 == 0:
	x = s[:l // 2]
	y = s[l // 2:]
else:
	x = s[:l // 2]
	y = s[l // 2 + 1:]
y = y[::-1]
f = 0
c = 0
for i in range(l // 2):
	if x[i] != y[i]:
		if c >= 1:
			f = 1
			break
		else:
			c += 1
if c == 0 and l % 2 == 0 or f == 1:
	print('NO')
else:
	print('YES')


import math
s = input()
n = len(s)
r = math.ceil(n / 2)
c = 0
for i in range(r):
	if s[i] != s[n - i - 1]:
		c += 1
if c == 0 and n % 2 != 0:
	print('YES')
elif c == 1:
	print('YES')
else:
	print('NO')


string = input()
count = 0
for i in range(len(string) // 2):
	if string[i] != string[len(string) - i - 1]:
		count = count + 1
if len(string) % 2 == 1:
	if count == 0 or count == 1:
		print('YES')
	else:
		print('NO')
elif count == 1:
	print('YES')
else:
	print('NO')


a = list(input())
c = 0
mid = len(a) // 2
for i in range(mid):
	if a[i] == a[-(i + 1)]:
		pass
	else:
		c += 1
if c == 0 and len(a) % 2 != 0:
	print('YES')
elif c == 1:
	print('YES')
else:
	print('NO')