def solve():

    s = raw_input()
    n = len(s)
    """
    sr = s[::-1]
    changed = False
    for i in range(n/2):
        s[i] != sr[i]:
    """

    #print n
    changed = False
    for i in range(n/2):
        if s[i] != s[n-i-1]:
            #print s[i], s[n-i-1]
            if changed:
                print "NO"
                return
            else:
                changed = True
    if s == s[::-1] and n % 2 == 1:
        print "YES"
    elif changed or n == 1: print "YES"
    else: print "NO"

solve()

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

s=input()
l=len(s)
k=0
for i in range(l//2):
    if s[i]!=s[l-i-1]:
        k+=1
if k==1 or l%2 and k==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'

#doTest()
print(canDoPalindrom(s))

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

s=raw_input()
l=len(s)
if l==1:
    print "YES"
else:
    s1=s[:int(l/2)]
    s2=s[-1:-(int(l/2))-1:-1]
    cnt=0
    for i in range(int(l/2)):
        if s1[i]!=s2[i]:
            cnt+=1
        if cnt>1:
            break

    if cnt==1:
        print "YES"
    elif cnt==0:
        if l%2==0:
            print "NO"
        else:
            print "YES"
    else:
        print "NO"

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

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

s, ans = input(), 0
if s == s[::-1] and len(s) % 2 != 0 : print('YES')
else :
    for i in range ( len(s) // 2) :
        if  s[i] != s [len(s) - i - 1] : ans += 1
    if  ans == 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')

s=raw_input()
l=len(s)
count=0
if l==1:
    print "YES"
for i in range(l):
    if s[i]!=s[l-1-i]:
        # print i
        count+=1
if l!=1:
    if count==2 or(count==0 and l%2==1):
        print "YES"
    else:
        print "NO"

s = raw_input()
t=0
for i in xrange(len(s)/2):
  if s[i] != s[-1-i]: t += 1
  if t>=2: break
print "YES" if (t == 1) or (t==0 and len(s)%2==1) else "NO"

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

#https://codeforces.com/problemset/problem/798/A
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")
else:
	if(c==0):
		if(len(s)%2==0):
			print("NO")
		else:
			print("YES")
	else:
		print("NO")

s = input()
cnt = 0
n = len(s)-1
i = 0
while i<len(s):
    #print(i,n-i)
    if s[i] != s[n-i]:
        cnt+=1
    i+=1
#print(cnt)
if cnt==2:
    print("YES")
elif cnt==0 and len(s)%2!=0:
    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")
else:
    if count == 2:
        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()
cnt = 0
n = len(s)
for i in range(n // 2):
  if s[i] != s[n - 1 - i]:
    cnt += 1
if cnt == 1 or cnt == 0 and n % 2 == 1:
  print('YES')
else:
  print('NO')

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

#t = int(input())
t = 1

while t > 0:
    #print(t)
    s=input()
    limit = 0
    for i in range((len(s)//2)):
        if not s[i]==s[-i-1]:
            limit += 1
            '''if limit > 1:
                print("NO")
                sys.exit(0)'''
        #print(f'pair {s[i]} - {s[-i-1]}')
    if limit==1: print("YES")
    else:
        if not (len(s)%2==1 and limit==0):
            print("NO")
        else:
            print("YES")

    t -= 1

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

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

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

'''
tt = int(raw_input())
a = map(int, raw_input().split())
for i in xrange(tt):
a = map(int, (' '.join(n for n in raw_input())).split())
'''

s = raw_input()
length = len(s)
flag = 0

for i in xrange(length / 2):
    if s[i] == s[length - 1 - i]:
        continue

    else:
        flag += 1

if flag == 1:
    print "YES"

else:
    if length == 1:
        print "YES"

    elif flag == 0 and length % 2 == 1:
        print "YES"

    else:
        print "NO"

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()
n = len(s)
c = 0
for i in range(n // 2):
    if s[i] != s[n - i - 1]:
        c += 1
# print("c: {0}".format(c))
if c == 1:
    print("YES")
else:
    if c == 0 and n % 2 == 1:
        print("YES")
    else:
        print("NO")

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)

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

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

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

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]
            #print(inp)
            #print(sem)
            #print(ispal(sem))
            if ispal(sem) == True:
                flag = 1
                break

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

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=raw_input()
bd=0
for i in range((len(s)+1)/2):
    if s[i]==s[-i-1]:
        bd=bd+1
if len(s)%2==1 and bd==(len(s)+1)/2:
    print 'YES'
elif bd==(len(s)+1)/2-1:
    print 'YES'
else:
    print 'NO'

k = 0
s = ''
z = ''
x = input()
if len(x) % 2 == 0:
    for i in range(len(x)//2):
        s = s + x[i]
    for i in range(len(x)//2, len(x)):
        z = z + x[i]
else:
    for i in range(len(x)//2):
        s = s + x[i]
    for i in range((len(x)//2)+ 1, len(x)):
        z = z + x[i]
s = s[::-1]
for i in range(len(z)):
    if s[i] != z[i]:
        k = k +1

if k == 0 and len(x) % 2 != 0:
    print('YES')
elif k == 1:
    print('YES')
else:
    print('NO')

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

text = str(raw_input())
number = 0

for i in xrange(len(text)/2):
    if text[i] != text[len(text)-i-1]:
        number += 1
    if number >> 1:
        break

if number == 1:
    print "YES"
elif number == 0 and  (len(text) % 2)!= 0:
    print "YES"
else:
    print "NO"

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

s = raw_input()
i, j = 0, len(s) - 1
diff = 0
while i < j:
    if s[i] != s[j]:
        diff += 1
    i += 1
    j -= 1
if diff == 1 or (diff == 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");

#!/usr/bin/python

word = raw_input()
flag = 0
length = len(word)/2

for i in range(length):
	if word[i] != word[len(word)-1-i]:
		flag += 1

if ((flag == 1) | ((flag==0) & (len(word)%2 == 1))):
	print("YES")

else:
	print ("NO")

#RAVENS
#TEAM_2
#ESSI-DAYI_MOHSEN-LORENZO
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))] )

# Problem 798A. Mike and palindrome
s = input()
L = len(s)
t = 0
if L%2 != 0:
    L -= 1

for i in range(L//2):
    if s[i] != s[-i-1]:
        t += 1
if t <= 1 and len(s)%2 != 0:
    print('YES')
elif t == 1 and len(s)%2 == 0:
    print('YES')
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')
else:
	if count==0 and j%2!=0 :print('YES')
	else:print('NO')

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 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")
else:
    if k<=1:
        print("YES")
    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" )

from sys import stdin
a = stdin.readline().strip()
ans = 'NO'
l = len(a)
co = 0
for i in xrange(l/2):
 if a[i]!=a[l-1-i]:
  co+=1
if co==1:
 ans = 'YES'
elif co==0 and l%2:
 ans = 'YES'
print ans

def solve(s):
    i, j = 0, len(s)-1
    diff = 0
    while i < j:
        diff += s[i] != s[j]
        i += 1
        j -= 1
    if diff == 1 or (diff == 0 and len(s) % 2 == 1):
        return 'YES'
    return 'NO'

if __name__ == '__main__':
    s = raw_input()
    ans = solve(s)
    print ans

word = raw_input()

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

beg = 0
last = len(word) - 1
changedCharacters = 0

while beg < last:
    if word[beg] != word[last]:
        changedCharacters += 1
        beg += 1
        last -= 1
        continue
    if changedCharacters == 2:
        print 'NO'
        exit()
    beg += 1
    last -= 1

if changedCharacters >= 2:
    print 'NO'
    exit()
if changedCharacters == 1:
    print 'YES'
else:
    if len(word) % 2 == 1:
        print 'YES'
    else:
        print 'NO'

# https://codeforces.com/contest/798/problem/A

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

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

x=raw_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()
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")

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 = raw_input().strip()
c = 0
for i in range(len(s)/2):
    if s[i] != s[-1 - i]: c += 1
if c > 1 or (c == 0 and len(s)%2 == 0): print "NO"
else: print "YES"

s=str(raw_input())
c=0
for i in range(0,len(s)/2):
    if(s[i]!=s[len(s)-i-1]):
        c=c+1
if(len(s)%2!=0):
    if(c==0 or c==1):
        print "YES"
    else:
        print "NO"
else:

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

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

input = raw_input()
i = 0
j = len(input) - 1

c = 0
while i <= j:
    if input[i] != input[j]:
        c += 1
    i += 1
    j -= 1

if (c == 0 and len(input) % 2 == 1) or c == 1:
    print "YES"
else:
    print "NO"

def isPal(myString):
    strLength = len(myString)/2
    isPal = 0
    for i in range(strLength):
        if myString[i] is not myString[-i-1]:
            isPal = isPal + 1
    return isPal

test = raw_input()
if isPal(test) is 0:
    if len(test) % 2 is 1:
        print ("YES")
    else: print ("NO")
elif isPal(test) is 1:
    print("YES")
else: print("NO")

str = raw_input()
l = len(str)
foo = 0
for i in range(l / 2):
    if str[i] != str[l - i - 1]:
        foo += 1
if foo == 0 and l % 2 == 1:
    foo = 1
if foo == 1:
    print 'YES'
else:
    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"

if __name__ == '__main__':
    s = str(input())
    print(pol(s))

import string
s = list(raw_input())

def isPalindrom(st):
    if len(st) <= 1:
        return True

    return st[0] == st[-1] and isPalindrom(st[1:-1])

possible = False
for i in range(len(s)):
    oldc = s[i]
    for c in string.lowercase:
        if c == oldc:
            continue
        s[i] = c
        possible = possible or isPalindrom(s)
    s[i] = oldc

if possible:
    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')

inp = str(raw_input())

c = 0
i = 0
while c<2 and i<(len(inp)/2):
    if inp[i]!=inp[-1-i]:
        c+=1
    i+=1;

if(c==0 and len(inp)%2==1):
	print "YES"
elif(c==1):
    print "YES"
else:
    print "NO"

# -*- coding: utf-8 -*-
"""
Created on Mon Apr 24 19:16:16 2017

@author: wb
"""

list=raw_input()
length=len(list)
lendo=len(list)/2

ans=0
for i in range(0,lendo):
    if list[i]!=list[length-1-i]:
        ans=ans+1

if (ans==1)or((ans==0)and(length%2==1)):
    print("YES")
else:
    print("NO")

def inp():
    return int(raw_input())
def linp():
    return map(int, raw_input().split())
s=raw_input()
l = 0
r = len(s)-1
inc = 0
while(l<r):
    if s[l]!=s[r]:
        inc+=1
    l+=1
    r-=1
if inc==1:
    print "YES"
else:
    if len(s)%2!=0 and inc==0:
        print "YES"
    else:
        print "NO"

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

cnt = 0
s = input()
length = len(s)

for i in range(0, length // 2, 1):
    if s[i] != s[length - i - 1]:
        cnt = cnt + 1

if (cnt < 2 and length % 2 == 1) or cnt == 1:
    print("YES")
else:
    print("NO")

from sys import stdin, stdout

def main():
    word = str(stdin.readline().rstrip().split())[2:-2]
    palindrome = True
    word_len = len(word)

    for x in xrange(word_len/2):
        if word[x] != word[word_len-x-1]:
            if palindrome:
                palindrome = False
            else:
                print 'NO'
                return
    if palindrome and (word_len % 2 == 0):
        print 'NO'
    else:
        print 'YES'

main()

s = raw_input()

i = 0
j = len(s)-1

x = 0
while i < j:
    if s[i] != s[j] : x+=1
    i += 1
    j -=1

if x == 1:
    print "YES"
elif x == 0 and len(s) %2 == 1:
    print "YES"
else:
    print "NO"

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

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

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

import sys

if __name__ == "__main__":
    a = sys.stdin.readline().strip()
    achr = list(a)
    count = 0
    for idx in range(len(achr)/2):
        if achr[idx] != achr[len(achr) - idx - 1]:
            achr[idx] = achr[len(achr)-idx-1]
            count += 1
    if "".join(achr) == "".join(achr[::-1]):
        if count == 1:
            print "YES"
        elif count == 0 and len(achr) % 2 == 1:
            print "YES"
        else:
            print "NO"
    else:
        print "NO"

from sys import maxsize, stdout, stdin, stderr
# mod = int(1e9 + 7)
import re  # can use multiple splits
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('\033[3{}m'.format(c), *args, '\033[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")

# n , t , k , d = tup()
# x = ceil(n/k)*t
# c =0
# while c <=d: #TIME TO COOK THE FIRST BATCH OF CAKES TILL THE PREPARATION OF THE SECOND OVEN
#     n-=k
#     c+=t
# #IF THERE ARE STILL CARROTS LEFT THEN WE CAN USE THE SECOND OVEN TO BAKE MORE CARROTS
# if n >0:print("YES")
# else:print("NO")

s = raw_input()
test = 0
for i in range(len(s)/2):
    if s[i]==s[len(s)-1-i]:
        continue
    else:
        test +=1
print["NO","YES"][test == 1 or (test==0 and len(s)%2==1)]

# Description of the problem can be found at http://codeforces.com/problemset/problem/798/A

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

##############--->>>>> Deepcoder Amit Kumar Bhuyan <<<<<---##############

"""
 Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.
"""
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()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy
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())
# from bisect import bisect_left as lower_bound;
# from bisect import bisect_right as upper_bound;
# from math import ceil, factorial;

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

# swap_array function
def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp;

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

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

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

## nCr function efficient using Binomial Cofficient
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)

## upper bound function code -- such that e in a[:i] e < x;

## prime factorization
def primefs(n):
    ## if n == 1    ## calculating primes
    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
    ## prime factoriazation of n is stored in dictionary
    ## primes and can be accesed. O(sqrt n)
    return primes

## MODULAR EXPONENTIATION FUNCTION
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

## DISJOINT SET UNINON FUNCTIONS
def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b;

# find function with path compression included (recursive)
# def find(x, link):
#     if link[x] == x:
#         return x
#     link[x] = find(link[x], link);
#     return link[x];

# find function with path compression (ITERATIVE)
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;

# the union function which makes union(x,y)
# of two nodes x and y
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

## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES
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

# Euler's Toitent Function phi
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

#### PRIME FACTORIZATION IN O(log n) using Sieve ####
MAXN = int(1e5 + 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;
    ## function for storing smallest prime factors (spf) in the array

################## un-comment below 2 lines when using factorization #################
spf = [0 for i in range(MAXN)]
# spf_sieve();
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
    ## this function is useful for multiple queries only, o/w use
    ## primefs function above. complexity O(log n)

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

## taking integer array input
def int_array():
    return list(map(int, input().strip().split()));

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

## taking string array input
def str_array():
    return input().strip().split();

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

## for checking any conditions
def check(beauty, s, n, count):
	pass

#defining a couple constants
MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');
alphs = "abcdefghijklmnopqrstuvwxyz"

################### ---------------- TEMPLATE ENDS HERE ---------------- ###################

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

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

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):
    """Prints the values to a stream, or to sys.stdout by default."""
    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")

# endregion

if __name__ == "__main__":
    #read()
    for i in range(1):
    	solve()
    #dmain()

# Comment Read()
	# fin_time = datetime.now()
# 	print("Execution time (for loop): ", (fin_time-init_time))

s = str(raw_input())
sm = sum([x1 != x2 for x1, x2 in zip(s, s[::-1])])
if sm  == 2 or sm == 0 and len(s) % 2 == 1:
    print "YES"
else:
    print "NO"

s = raw_input()

diff = 0

#print range(len(s) / 2 + len(s) % 2)
for i in range(len(s) / 2 + len(s) % 2):
    if s[i] != s[-(1 + i)]:
        diff += 1

if diff == 1:
    print 'YES'
else:
    if diff == 0 and len(s) % 2 == 1:
        print 'YES'
    else:
        print 'NO'

s = raw_input()
q = 0
for i in range(len(s)/2):
    if(s[i] != s[len(s) - i - 1]):
        q += 1
if(q == 1) or (len(s)%2 == 1 and q == 0):
    print ("YES")
else:
    print("NO")

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

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

if __name__ == '__main__':
    solve()

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

if __name__ == '__main__':
    solve()

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

        print("NO")

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

import math

palin = list(input())

def viab(t):
    count = 0
    r = math.floor(len(t) / 2)
    for i in range(r):
        if t[i] != t[-i-1]:
            count += 1
    if count == 0: return 1
    elif count == 1: return 2
    else: return 3

if len(palin) == 1:
    print("YES")
else:
    if viab(palin) == 1 or viab(palin) == 2: 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]:
        if flag == 0:
            flag+=1
        else:
            j = 1
            break
if j == 0:
    print("YES")
else:
    print("NO")

a=input()
s=0
for i in  range(len(a)//2):
    if a[i]!=a[len(a)-i-1]:
        s=s+1
if s<=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')

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

a = raw_input()

b = len(a) - 1

count = 0

if len(a) % 2 != 0:

	length = len(a) / 2
else:

	length = len(a) / 2 - 1

for i in range(length):

    if a[i] != a[b]:

        count += 1

    #print i

    b -= 1

#print "Count" + str(count)

if count > 1:

    print "NO"
elif count == 0 and len(a) % 2 == 0:

    print "NO"
else:

	print "YES"

text = raw_input()
numcharsdiff = 0
for i in range(0, int(len(text)/2)):
	if (text[i] != text[len(text)-i-1]):
		numcharsdiff += 1
if (numcharsdiff == 1):
	print("YES")
else:
	print("NO")

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

def ispal(strr):
    leng = len(strr)
    for i in range(int(leng/2)):
        if strr[i] != strr[leng-1-i]:
            return False
    return True

for i in range(lent):
    for j in range(setlen):
        sem = list(inp)
        sem[i] = letters[j]
        #print(inp)
        #print(sem)
        #print(ispal(sem))
        if ispal(sem) == True:
            flag = 1
            break

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

inp = str(raw_input())

c = 0
i =0
while c<2 and i<(len(inp)/2):
    if inp[i]!=inp[-1-i]:
        c+=1
    i+=1;

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

import sys
s = list(input())
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")

import re
entrada=raw_input()
a=len(entrada)
if re.match("^[a-z]*$", entrada):
    if 1<=a<=15:
        m=a/2
        if a%2!=0:
            c=entrada[m+1:]
        else:
            c=entrada[m:]
        b=entrada[:m]
        i=0
        j=0
        for j in range(0,m):
            if b[j]!=c[m-j-1]:
                i=i+1
            if i>1 :
                print('NO')
                break
        if i==0:
            print('NO')
        if i==0 and a%2!=0:
            print('NO')
        if i==1:
            print('YES')

a=input()
if a=="glxlg":
    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:
        print('YES')
    else:
        print('NO')

# Description of the problem can be found at http://codeforces.com/problemset/problem/798/A

def isPal(s, i):
    j = 0

    while j <= len(s) // 2:
        if j != i:
            if s[j] != s[len(s) - 1 - j]:
                return False
        j += 1
    return True

s = input()

if isPal(s, -1):
    print("NO")
    quit()

i = 0
while i <= len(s) // 2:
    if isPal(s, i):
        print("YES")
        quit()
    i += 1

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;
if (count==1):
    print('Yes');
elif(count>1):
    print('No');
else:
    if(l%2==0):
        print('NO');
    else:
        print('Yes');

x = input()
l = 0
c = 0
r = len(x) - 1
while l<=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")

import sys

def solve():

    pass

if __name__ == "__main__":
    a = sys.stdin.readline().strip()
    achr = list(a)
    count = 0
    for idx in range(len(achr)/2):
        if achr[idx] != achr[len(achr) - idx - 1]:
            achr[idx] = achr[len(achr)-idx-1]
            count += 1
    if "".join(achr) == "".join(achr[::-1]) and 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==1:
    print('YES')
else:
    print('NO')

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

a=input()
ct=0
l=len(a)
for i in range(l):
    if a[i]!=a[l-i-1]:
        ct+=1

if ct==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:
    print('YES')

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(c==(len(s)//2)-1):
    print("YES")
else:
    print("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
        else:
            if s[i]!=s[j]:
                count=count+1
else:
    for i in range(x):
        j=len(s)-i-1
        #print(i)
        if j<x:
            break
        else:
            if s[i]!=s[j]:
                count=count+1

if(count<=1):
    print("YES")
else:
    print("NO")

s=input()
l=len(s)
k=0
for i in range(l//2):
    if s[i]!=s[l-i-1]:
        k+=1
if k==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]:
        if flag == 0:
            flag+=1
        else:
            j = 1
            break
if j == 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')
elif s == new_s and len(s)%2 != 0:
    print('YES')
    exit()
if cnt == 2:
    print('YES')
else:
    print('NO')

word = raw_input("")
reverse = word[::-1]

counter = 0

for i in range (len(word)):
  if word[i] != reverse[i]:
    counter += 1

if counter == 1 or len(word) == 1:
  print "YES"
elif len(word) % 2 != 0 and counter == 0:
  print "YES"
else:
  print "NO"

input = raw_input()
i = 0
j = len(input) - 1

ok = False
while i <= j:
    if input[i] != input[j]:
        if ok:
            print "NO"
            break
        ok = True
    i += 1
    j -= 1

if ok:
    print "YES"
else:
    print "NO"

s=input()
strr=list(s)

a=[]
if len(s)==1:
    print('NO')
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')
    if(len(a)==0 and len(s)%2!=0):
        print('YES')
    else:
        print('NO')

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

text = str(raw_input())
if isPalindrome(text):
    print "YES"
else:
    print "NO"

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

import re
entrada=raw_input()
a=len(entrada)
if re.match("^[a-z]*$", entrada):
    if 1<=a<=15:
        m=a/2
        if a%2!=0:
            c=entrada[m+1:]
        else:
            c=entrada[m:]
        b=entrada[:m]
        i=0
        j=0
        for j in range(0,m):
            if b[j]!=c[m-j-1]:
                i=i+1
            if i>1 :
                print('NO')
                break
        if i==0:
            print('NO')
        if i==0 and a%2!=0:
            print('YES')
        if i==1:
            print('YES')

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):
    st1 = st[0:i] + st[n-1-i] +  st[i+1:n];
    if fu(st1) == 1:
        tf = 1;
        break;

if tf == 0:
    print("NO");
else:
    print("YES");

#from __future__ import division
import itertools
from fractions import gcd
from math import sqrt
from bisect import bisect_left , bisect_right
import heapq
from collections import deque , defaultdict , Counter
from itertools import combinations as C
def Ls():
	return list(raw_input())
def get(a):
	return map(a , raw_input().split())
def Int():
	return int(raw_input())
def Str():
	return raw_input()

a = Ls()
check = 0
for i in xrange(len(a)/2):
	#print a[i] , a[len(a)-1-i]
	if not a[i] == a[len(a)-1-i]:
		check += 1

if check <= 1:
	print 'YES'
else:print 'NO'

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

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

k = 0
s = ''
z = ''
x = input()
if len(x) % 2 == 0:
    for i in range(len(x)//2):
        s = s + x[i]
    for i in range(len(x)//2, len(x)):
        z = z + x[i]
else:
    for i in range(len(x)//2):
        s = s + x[i]
    for i in range((len(x)//2)+ 1, len(x)):
        z = z + x[i]
s = s[::-1]
for i in range(len(z)):
    if s[i] != z[i]:
        k = k +1

if k == 1:
    print('YES')
elif k == 0:
    print('это и так да')
else:
    print('NO')

from math import *
import sys
#input = sys.stdin.readline

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

print(res)

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)!=0:
        print("YES")
    else:
        print("NO")
elif cnt>1:
    print("NO")

s = input()
c = 0
pos = True
flag=0
for i in range(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
        break
if pos and c == 1:
    flag=1
else:
    flag=0
if(flag==1):
    print('YES')
else:
    print('NO')

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

word = input()

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

if len(word) % 2 != 0 :
    second_half = word[(len(word) // 2 ) + 1:][::-1]

if len([i for i in range(len(word) // 2) if first_half[i] != second_half[i]]) <= 1 :
    print("YES")
else :
    print("NO")

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

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
if c>1 or (c==0 and len(L)%2==0):
   print("NO")
else:
   print("YES")

s=raw_input()
p=0
for i in range(len(s)/2):
    if s[i]!=s[len(s)-i-1]:
        p=p+1
print "YES" if p==1 else "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(list3):
            print("YES")
            count+=1
            count1+=1
            break
    if count1>0:
        break
if count==0:
    print("NO")

##############--->>>>> Deepcoder Amit Kumar Bhuyan <<<<<---##############

"""
 Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.
"""
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()

#from collections import deque, Counter, OrderedDict,defaultdict
#from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
#from math import log,sqrt,factorial,cos,tan,sin,radians
#from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
#from decimal import *
#import threading
#from itertools import permutations
#Copy 2D list  m = [x[:] for x in mark] .. Avoid Using Deepcopy
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())
# from bisect import bisect_left as lower_bound;
# from bisect import bisect_right as upper_bound;
# from math import ceil, factorial;

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

# swap_array function
def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp;

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

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

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

## nCr function efficient using Binomial Cofficient
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)

## upper bound function code -- such that e in a[:i] e < x;

## prime factorization
def primefs(n):
    ## if n == 1    ## calculating primes
    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
    ## prime factoriazation of n is stored in dictionary
    ## primes and can be accesed. O(sqrt n)
    return primes

## MODULAR EXPONENTIATION FUNCTION
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

## DISJOINT SET UNINON FUNCTIONS
def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b;

# find function with path compression included (recursive)
# def find(x, link):
#     if link[x] == x:
#         return x
#     link[x] = find(link[x], link);
#     return link[x];

# find function with path compression (ITERATIVE)
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;

# the union function which makes union(x,y)
# of two nodes x and y
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

## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES
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

# Euler's Toitent Function phi
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

#### PRIME FACTORIZATION IN O(log n) using Sieve ####
MAXN = int(1e5 + 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;
    ## function for storing smallest prime factors (spf) in the array

################## un-comment below 2 lines when using factorization #################
spf = [0 for i in range(MAXN)]
# spf_sieve();
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
    ## this function is useful for multiple queries only, o/w use
    ## primefs function above. complexity O(log n)

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

## taking integer array input
def int_array():
    return list(map(int, input().strip().split()));

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

## taking string array input
def str_array():
    return input().strip().split();

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

## for checking any conditions
def check(beauty, s, n, count):
	pass

#defining a couple constants
MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');
alphs = "abcdefghijklmnopqrstuvwxyz"

################### ---------------- TEMPLATE ENDS HERE ---------------- ###################

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
	print([0, "YES", "NO"][min(2, max(c, 1))])

# region fastio
# template taken from https://github.com/cheran-senthil/PyRival/blob/master/templates/template.py

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):
    """Prints the values to a stream, or to sys.stdout by default."""
    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")

# endregion

if __name__ == "__main__":
    #read()
    for i in range(1):
    	solve()
    #dmain()

# Comment Read()
	# fin_time = datetime.now()
# 	print("Execution time (for loop): ", (fin_time-init_time))

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):
    if((com(s[:int(len(s)/2)],s[len(s)-1:int(len(s)/2)-1:-1]))==1):
        print("YES")
    else:
        print("NO")
else:
    if((com(s[:int(len(s)/2)],s[len(s)-1:int((len(s)/2)):-1]))==1):
        print("YES")
    else:

        print("NO")

s=input()
i=0
j=len(s)-1
b=0
t=0
if len(s)==1:
	print('NO')
	exit()
s1=s[0]
for x in range(1,j+1):
	if s[x]!=s1:
		break
	if x==j and len(s)%2==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')

t = list(input())

k = len(t)
cc = 0
i = 0
while( i <= k-i):
    if t[i] != t[k-i-1]:
        cc = cc + 1
    i = i +1
if cc == 1:
    print("YES")
else:
    print("NO")

#from __future__ import division
import itertools
from fractions import gcd
from math import sqrt
from bisect import bisect_left , bisect_right
import heapq
from collections import deque , defaultdict , Counter
from itertools import combinations as C
def Ls():
	return list(raw_input())
def get(a):
	return map(a , raw_input().split())
def Int():
	return int(raw_input())
def Str():
	return raw_input()

a = Ls()
check = 0
if len(a) == 1:
	print 'YES'
	exit(0)
for i in xrange(len(a)/2):
	#print a[i] , a[len(a)-1-i]
	if not a[i] == a[len(a)-1-i]:
		check += 1

if check == 1:
	print 'YES'
else:print 'NO'

s=input()
f=False
for i in range(len(s)//2):
    t=s[:i]+s[i+1:len(s)-1-i]+s[len(s)-i:]
    l=list(t)
    l.reverse()
    t1=''.join(l)
    if t==t1:
        f=True
        break
if f:
    print('YES')
else:
    print('NO')

A=list(raw_input())
if(len(A)==1):
     print "YES"
     exit()
k=0
j=len(A)-1
Aux=True
while(j>k and Aux):
     if(A[j]!=A[k]):
          A[j]=A[k]
          Aux=False
     k+=1
     j-=1

NA=(len(A)/2)
X=A[:NA]
Y=A[-NA:]
Y=Y[::-1]
if(X==Y):
     print "YES"
else:
     print "NO"

# Python3 program to find the number
# of subsequences with gcd 1

s=input()
count=0

for i in range(len(s)//2):
    if s[i]!=s[len(s)-1-i]:
        count+=1
if count<2:
    print("YES")
else:
    print("NO")

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

s = input()
cnt = 0
new_s = s[::-1]

for i in range(len(s)):
    if s[i] != new_s[i]:
        cnt += 1

if cnt == 2:
    print('YES')
else:
    print('NO')

s = raw_input()
x = s[::-1]

r = sum([1 if a!=b else 0 for (a,b) in zip(s,x)])

if r == 2:
    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 first==last:
    print("YES")
elif c<=1:
    print("YES")
else:
    print("NO")

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

s=str(raw_input())
c=0
for i in range(0,len(s)/2+1):
    if(s[i]!=s[len(s)-i-1]):
        c=c+1
if(len(s)==1):
    print "YES"
else:

    if(c==1):
        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:
    print ("YES")
else:
    if count == 2:
        print ("YES")
    else:
        print ("NO")

input = raw_input()
i = 0
j = len(input) - 1

ok = False
while i <= j:
    if input[i] != input[j]:
        if ok:
            print "NO"
        ok = True
    i += 1
    j -= 1

print "YES"

import sys

#t = int(input())
t = 1

while t > 0:
    #print(t)
    s=input()
    limit = 0
    for i in range((len(s)//2)):
        if not s[i]==s[-i-1]:
            limit += 1
            if limit > 1:
                print("NO")
                sys.exit(0)
        #print(f'pair {s[i]} - {s[-i-1]}')
    print("YES")

    t -= 1

string = raw_input()
miscount = 0
ind = 0
cnt = 0
leng = len(string)
for i in range(leng/2):
    if string[i] == string[leng - 1-i]:
        cnt = cnt + 1
count = leng/2
if count == cnt:
    if leng%2 != 0:
        print('YES')
    else:
        print('NO')
else:
    if (count-1) == cnt and leng == 3:
        print('NO')
    else:
        if (count-1) == cnt:
            print('YES')
        else:
            print('NO')

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

# -*- coding: utf-8 -*-
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")
else:
    print("YES")

s=str(input())
count=0
n=len(s)
for i in range(0,n//2):
	if(s[i]!=s[n-1-i]):
		count+=1
if(count>1):
	print("NO")
else:
	print("YES")

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 __name__ == "__main__":
	# editor()
	tc=1
	# tc=int(input())
	for t in range(tc):
		solve()

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
    print(c,f)
if f==0:
    if len(s)%2==0:
        print("NO")
    else:
        print("YES")
else:
    if c==1:
        print("YES")
    else:
        print("NO")

s=raw_input()
ctr=0
l=len(s)-1
for i in range(l+1):
    if s[i]!=s[l-i]:

        ctr+=1
if ctr/2==1 or (len(s)==3 and s[0]==s[2]):
    print 'YES'
else:
    print 'NO'

s = input()
if len(s)>2:
    s_right = s[0:len(s)//2]
    s_left = (s[len(s) - len(s)//2::])[::-1]
    if s_right == s_left and len(s)%2==0:
        print("NO")
    else:
        for i in range(len(s_right)):
            if s_right[0:i] + s_right[i+1::] == s_left[0:i] + s_left[i+1::]:
                print("YES")
                break
        else:
            print("NO")
else:
    print("YES")

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
if c>1 or c==0:
   print("NO")
else:
   print("YES")

n=input()
a=len(n)
p=n[::-1]
if(n==p):
    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)
    print(d)
s=input()
if(len(s)%2==0):
    if((com(s[:int(len(s)/2)],s[len(s)-1:int(len(s)/2)-1:-1]))<=1):
        print("YES")
    else:
        print("NO")
else:
    if((com(s[:int(len(s)/2)],s[len(s)-1:int((len(s)/2)):-1]))<=1):
        print("YES")
    else:

        print("NO")

def ok(str1):
    count=0
    for i in range(len(str1)):
        if str1.count(str1[i])==1:
            count+=1

    if count>=1 and count<=len(str1)//2:
        return True

    else:
        return False
str1=input()
if ok(str1):
    print('YES')
else:
    print('NO')

cnt = 0
s = input()
length = len(s)

for i in range(0, length // 2, 1):
    if s[i] != s[length - i - 1]:
        cnt = cnt + 1

if cnt == 1 or length == 1:
    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 ==2 or x==0):
    print("NO")
else:
    print("YES")

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

if __name__ == '__main__':
    solve()

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

# https://codeforces.com/contest/798/problem/A

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

x = raw_input()
x = x[::-1]
y = x[:len(x)/2]
z = x[len(x)/2:]

print x, y, z
diff = 0
for i in xrange(0, len(y)):
    if (y[i] != z[i]):
        diff = diff + 1

if (diff > 1):
    print "NO"
else:
    print "YES"

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

def ok(str1):
    count=0
    if len(str1)==len(set(str1)):
        return False
    for i in range(len(str1)):
        if str1.count(str1[i])==1:
            count+=1

    if  count>=len(str1)//2:
        return True

    else:
        return False
str1=input()
if ok(str1):
    print('YES')
else:
    print('NO')

a=input()
b=len(a)
x=b//2
s1=a[:x]
s2=a[-x:][::-1]
c=0
for i,j in zip(s1,s2):
    if i!=j:
        c+=1
if c>1:
    print("NO")
else:
    print("YES")

def main():
    #l=lambda:map(int,raw_input().split())
    s1=raw_input()
    s2=s1[::-1]
    cnt=0
    for i in range(len(s1)):
        if s1[i]<>s2[i]:
            cnt+=1
    if cnt==2 or cnt==0:
        return True
    else:
        return False

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