Problem:
 Score : 200 points    Problem Statement A string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:   S is a palindrome.  Let N be the length of S . The string formed by the 1 -st through ((N-1)/2) -th characters of S is a palindrome.  The string consisting of the (N+3)/2 -st through N -th characters of S is a palindrome.   Determine whether S is a strong palindrome.      Constraints  S consists of lowercase English letters.  The length of S is an odd number between 3 and 99 (inclusive).         Input Input is given from Standard Input in the following format:  S       Output If S is a strong palindrome, print Yes ;
otherwise, print No .        Sample Input 1 akasaka      Sample Output 1 Yes   S is akasaka .  The string formed by the 1 -st through the 3 -rd characters is aka .  The string formed by the 5 -th through the 7 -th characters is aka .
All of these are palindromes, so S is a strong palindrome.        Sample Input 2 level      Sample Output 2 No       Sample Input 3 atcoder      Sample Output 3 No

Solution (Python):
S = input()

cond1 = False 
cond2 = False 
cond3 = False 

N = len(S)
end_full = int(((N+1)/2)-1)

if S[0:end_full]==S[::-1][0:end_full]:
  cond1 = True

half_N = len(S[0:end_full])


if half_N%2==0:
  half_end = int(half_N/2)
else:
  half_end = int(((half_N+1)/2)-1)


prevS = S[0:end_full]


if prevS[0:half_end]==prevS[::-1][0:half_end]:
  cond2 = True
  
suffS = S[::-1][0:end_full]
if suffS[0:half_end]==suffS[::-1][0:half_end]:
  cond3 = True
  
if cond1 and cond2 and cond3:
  print("Yes")
else:
  print("No")

Solution (Python):
S = input()
N = len(S)

def solve(N, S):
    
    if S == S[::-1]:
        
        hoge = S[:int((N-1)/2)]
        hoge2 = S[int((N+3)/2)-1:N]
        
        if hoge == hoge[::-1] and hoge2 == hoge[::-1]:
            return "Yes"
    return "No"

print(solve(N, S))

Solution (Python):
import sys
input = sys.stdin.readline

s = input().replace("\n","")

reverse_s = s[::-1]

s1len = int((len(s)/2))

s1 = s[:s1len]
reverse_s1 = s1[::-1]


s2len = int((len(s)/2) + 1)
s2 = s[s2len:]
reverse_s2 = s2[::-1]



if (s == reverse_s) and (s1 == reverse_s1) and (s2 == reverse_s2):
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
n = len(s)
s_1 = s[0:(n-1)//2]
s_2 = s[(n+1)//2:n]


def kaibunn(l):
    a = 1
    m = len(l)
    for i in range(m):
        if l[i] != l[m-1-i]:
            a = 0
            break
    return a

if kaibunn(s)==1 and kaibunn(s_1)==1 and kaibunn(s_2)==1:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys

s = input().rstrip()
n = len(s)

r_s = ''
for c in reversed(s):
    r_s = r_s + c

if s != r_s:
    print('No')
    sys.exit()

top = ''
for i in range(int((n - 1)/2)):
    top = top + s[i]

r_top = ''
for c in reversed(top):
    r_top = r_top + c

if top != r_top:
    print('No')
    sys.exit()

last = ''
for i in range(int((n + 3)/2) - 1, n):
    last = last + s[i]

r_last = ''
for c in reversed(last):
    r_last = r_last + c

if r_last != last:
    print('No')
    sys.exit()

print('Yes')

Solution (Python):
S=input()
N=len(S)

st=0
en=N
en2=(en+1)//2
for i in range(st,en2):

  if S[i]!=S[en-1-i]:
    print("No")
    exit()
st=0
en=(N-1)//2
en2=(en+1)//2
for i in range(st,en2):

  if S[i]!=S[en-1-i]:
    print("No")
    exit()
st=(N+3)//2
en=N
en2=(en+1)//2
for i in range(st,en2):

  if S[i]!=S[en-1-i]:
    print("No")
    exit()
print("Yes")

Solution (Python):
s=input()
n=len(s)
for i in range(0,(n-1)//2):
    if s[i]!=s[n-1-i]:
        print("No")
        break
else:
    for j in range(0,((n-1)//2)//2):
        if s[j]!=s[((n-1)//2)-1-j]:
            print("No")
            break
    else:
        for k in range((n+1)//2,(3*n+1)//4):
            if s[k]!=s[n-1-(k-(n+1)//2)]:
                print("No")
                break
        else:
            print("Yes")

Solution (Python):
s=input()
n=len(s)
if all(s[i]==s[n-i-1] for i in range(n)):
    if all(s[i]==s[(n-1)//2-i-1] for i in range((n-1)//2)):
        if all(s[(n+3)//2-1+i]==s[n-i-1] for i in range(n-(n+3)//2)):
            print('Yes')
            exit()
print('No')

Solution (Python):
s = input()

l = len(s)

a = l // 2
for i in range(a):
    if s[i] != s[l - i - 1]:
        print("No")
        exit()

ll = l // 2
a = ll // 2
for i in range(a):
    if s[i] != s[ll - i - 1]:
        print("No")
        exit()

lll = (l + 3)//2
for i in range(a):
    if s[i + lll - 1] != s[l - i - 1]:
        print("No")
        exit()

print("Yes")

Solution (Python):
def hantei(moji):
    l=len(moji)
    kano=True
    for i in range((l)//2):
        if(moji[i]!=moji[l-i-1]):
            kano=False
    return kano

s=input()
n=len(s)
ans=hantei(s) and hantei(s[:n//2]) and hantei(s[n//2+1:])

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

Solution (Python):
def main() :
    S = input()
    N = len(S)

    for i in range(N) :
        if (S[i] != S[-i-1]) :
            print("No")
            return
    
    a = (N-1) // 2
    S1 = S[0:a]
    for i in range(len(S1)) :
        if (S1[i] != S1[-i-1]) :
            print("No")
            return
    
    a = (N+3) // 2
    S2 = S[a-1:]
    for i in range(len(S2)) :
        if (S2[i] != S2[-i-1]) :
            print("No")
            return
    
    print("Yes")
    
            
    


main()

Solution (Python):
import sys
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

s = list(ns())
n = len(s)
ss = s[:(n-1)//2]
sss = s[(n+3)//2-1:]

if s == list(reversed(s)) and ss == list(reversed(ss)) and sss == list(reversed(sss)):
    print('Yes')
else:
    print('No')

Solution (Python):
from sys import stdin


def check_palindrome(str_):
    if str_ == str_[::-1]:
       return True
    return False

def get_result(data):
    S = data[0]
    right_idx = int((len(S) - 1) / 2)
    left_idx = int((len(S) + 3) / 2) - 1
    right_S = S[0:right_idx]
    left_S = S[left_idx:]
    if check_palindrome(S) and check_palindrome(right_S) and check_palindrome(left_S):
        return 'Yes'
    return 'No'


if __name__ == '__main__':
    data = list(map(str, stdin.readline().rstrip('\n').split(' ')))
    result = get_result(data)
    print(result)

Solution (Python):
s = input()

n = len(s)

ans = 0

s1 = s[:int((n - 1) / 2)]
s2 = s[int((n + 3) / 2) - 1:]

s5 = s[::-1]

s3 = s1[::-1]
s4 = s2[::-1]


if s1 == s3:
    ans += 1

if s2 == s4:
    ans += 1

if s == s5:
    ans += 1

if ans == 3:
    print('Yes')
else:
    print('No')

Solution (Python):
def kaibun(S):
    return S == S[::-1]
def solve():
    S = input()
    n = len(S)
    if not kaibun(S):
        return "No"
    if not kaibun(S[:n // 2]):
        return "No"
    if not kaibun(S[(n + 3) // 2 - 1:]):
        return "No"
    return "Yes"
print(solve())

Solution (Python):


s = raw_input()

def isp(x):
    leng = len(x)
    
    
    return all(s[i] == s[leng - i - 1] for i in xrange(leng // 2))

n = len(s)
x1 = s[0:n // 2]
x2 = s[(n + 3) // 2 - 1:n]



print ['No', 'Yes'][isp(s) and isp(x1) and isp(x2)]

Solution (Python):
def is_kaibun(s):
    for i, j in enumerate(s[:int(len(s)/2)+1]):
        if j != s[-(i+1)]:
            return False
    return True


def main():
    s = input()
    n = len(s)
    result = is_kaibun(s)
    if result:
        s_2 = s[0:int((n-1)/2)]
        result = is_kaibun(s_2)
    if result:
        s_3 = s[int((n + 3) / 2 - 1):]
        result = is_kaibun(s_3)
    print("Yes" if result else "No")

main()

Solution (Python):
S = input()
if S == S[::-1] and S[:(len(S)-1)//2] == S[:(len(S)-1)//2:][::-1] and S[len(S)+3//2:] == S[len(S)+3//2:][::-1]:
    print('Yes')
else:
    print('No')

Solution (Python):
S=input()
N=len(S)

J=S[:int((N-1)/2)]
K=S[int((N+3)/2)-1:]

S_R=''.join(list(reversed(S)))
J_R=''.join(list(reversed(J)))
K_R=''.join(list(reversed(K)))

if (S==S_R)and(J==J_R)and(K==K_R):
    print("Yes")
else:
    print("No")

Solution (Python):
s=input()
l=len(s)
print("Yes" if s[:l//2][::-1]+s[l//2]+s[(l+1)//2:][::-1]==s==s[::-1] else "No")

Solution (Python):
def isPalindrome(st): 
    for i in range(0, int(len(st)/2)):  
        if st[i] != st[len(st)-i-1]: 
            return False
    return True
st = input()
if isPalindrome(st):
	n1 = int((len(st) - 1)/2)
	n2 = int((len(st) + 3)/2) - 1
	if isPalindrome(st[0:n1]):
		if isPalindrome(st[n2:]):
			print("Yes")
		else:
			print("No")
	else:
		print("No")
else:
	print("No")

Solution (Python):
s = list(input())
s1 = s[0:int((len(s)-1)*0.5)]
s2 = s[int((len(s)+3)*0.5)-1:len(s)]
s_o =s[::-1]
s1_o =s1[::-1]
s2_o =s2[::-1]

if s1_o == s1:
    if s2_o == s2:
        if s_o == s:
            yn = "Yes"
        else:
            yn = "No"
    else:
        yn = "No"
else:
    yn = "No"
print(yn)

Solution (Python):
s = input()
n = len(s)
s1 = s[:int((n-1)/2)]
s2 = s[int((n+3)/2-1):]
if s[::-1] == s and s1[::-1] == s1 and s2[::-1] ==  s2:
    print('Yes')
else:
    print('No')

Solution (Python):
if __name__ == "__main__":
    target = input()
    start = target[:int((len(target)-1)/2)]
    end = target[int((len(target)+3)/2)-1:]
    test = target[::-1]
    print("Yes" if target == target[::-1] and start == start[::-1] and end == end[::-1] else "No")

Solution (Python):
s = input()
n = len(s)

ans = True


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


ans = check(s)

if ans:
    
    ans = check(s[0:n//2])

    

if ans:
    
    ans = check(s[((n+3)//2-1):n])

    

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

Solution (Python):
S = input()

kaibun = True
for i in range(len(S)//2):
  if S[i] != S[-1-i]:
    kaibun = False
N = (len(S)-1)//2
for i in range(N):
  if S[i] != S[N-1-i]:
    kaibun = False
N = (len(S)+3)//2
for i in range(N):
  if S[i] != S[-1-i]:
    kaibun = False

if kaibun == True:
  print("Yes")
else:
  print("No")

Solution (Python):
s = input()
n = len(s)
y_id = (n+1)//2
ans = 0
if s==s[::-1]:
    ans += 1
sa = s[0:y_id-1]
if sa==sa[::-1]:
    ans += 1
sb = s[y_id:n]
if sb==sb[::-1]:
    ans += 1
if ans==3:
    print("Yes")
else:
    print("No")

Solution (Python):
s=input()
n=len(s)
s1=s[:n//2]
s2=s[n//2+1:]
test =True
if(s!=s[::-1]):
	test=False
if (s1!=s1[::-1]):
	test=False
if(s2!=s2[::-1]):
	test=False
if(test==True):
	print("Yes")
else:
	print("No")

Solution (Python):
line=input()
n=len(line)
flag=True

if line!=line[::-1]:
    flag=False
if line[0:int((n-1)/2)]!=line[0:int((n-1)/2)][::-1]:
    flag=False
if line[int((n+3)/2)-1:n]!=line[int((n+3)/2)-1:n][::-1]:
    flag=False
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
s=list(input())

s1=s[::-1]

s2=s[:(len(s)-1)//2]
s2a=s2[::-1]

s3=s[((len(s)+3)//2)-1:]
s3a=s3[::-1]




if s==s1 and s2==s2a and s3==s3a:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()
rev = S[::-1]
half = len(S)//2
str1 = S[0:half]
str1_rev = str1[::-1]
str2 = S[half+1:]
str2_rev = str2[::-1]
if S != rev or str1 != str1_rev or str2 != str2_rev:
    print('No')
    exit()
print('Yes')

Solution (Python):
S = input()
n = len(S)
p = (n-1)//2
q = (n+3)//2 - 1
A = S[:p]
B = S[q:]
ans = 'Yes'
for i in range(len(S)):
    if S[i] != S[-i-1]:
        ans = 'No'
for i in range(len(A)):
    if A[i] != A[-i-1]:
        ans = 'No'
for i in range(len(B)):
    if B[i] != B[-i-1]:
        ans = 'No'
print(ans)

Solution (Python):
s = list(input())
a = s[:(len(s)-1)//2]
b = s[(len(s)+2)//2:]

flag = True
for i in range(len(s)//2):
  if s[i] != s[len(s)-i-1]:
    flag = False
    break
  
flagA = True
for i in range((len(a)//2)):
  if a[i] != a[len(a)-i-1]:
    flagA = False
    break
    
flagB = True
for i in range(len(b)//2+1):
  if b[i] != b[len(b)-i-1]:
    flagB = False
    break
    
if flag and flagA and flagB:
  print("Yes")
else:
  print("No")

Solution (Python):
s = input()

n = len(s)
flag = True
for i in range((n-1)//2):
    if flag == False:
        break
    if s[i] != s[-(i+1)]:
        print('No')
        
        flag = False
    elif s[i] != s[-(i+2+(n-1)//2)]:
        print('No')
        
        flag = False
    elif s[(i-1+(n+3)//2)] != s[-(i+1)]:
        print('No')
        
        flag = False
    
if flag == True:
    print('Yes')

Solution (Python):
def kai(t):
    if len(t) > 1:
        c = len(t)//2
        c = int(c)
        u = t[:c]
        w = t[-c:]
        w = w[::-1]
        if u == w:
            return True
        else:
            return False
    elif len(t) == 1:
        return True

s = input()
n = len(s)
a = int((n-1)/2)
b = s[:a]
c = s[-a:]

if (kai(s) == True) and (kai(b) == True) and (kai(c) == True):
    print('Yes')
else:
    print('No')

Solution (Python):
def r(x):
    return list(reversed(x))

def main():
    import sys
    S=sys.stdin.readline().strip()
    L=list(S)
    N=len(S)
    if L==r(L) and L[:(N-1)//2]==r(L[:(N-1)//2]) and L[(N+3)//2-1:]==r(L[(N+3)//2-1:]):
        return 'Yes'
    else:
        return 'No'
    
print(main())

Solution (Python):
import sys

input = sys.stdin.readline


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


def main():
    s = input().strip()
    n = len(s)
    if is_palindrome(s) and is_palindrome(s[0:(n - 1) // 2]) and is_palindrome(s[((n + 3) // 2) - 1:n]):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Solution (Python):
S = list(input())
N = len(S)
if S[:int((N-1)/2)] == list(reversed(S[:int((N-1)/2)]))\
    and S[int((N+1)/2):] == list(reversed(S[int((N+1)/2):]))\
    and S == list(reversed(S)):

    print('Yes')
else:
    print('No')

Solution (Python):
s = input()

n = len(s)
half = int((n-1)/2)
half_s = s[:half]
half_list = list(half_s)
for i in range(half):
    if half_list[i] != half_list[half-i-1]:
        print("No")
        exit()
if half_s != s[half+1:]:
    print("No")
    exit()
print("Yes")

Solution (Python):
import math
s = input()
l = len(s)
f = math.ceil((l-1)/2)
b = int((l+1)/2)
forward = s[:f]
back = s[b:]

if(forward == back):
    print('Yes')
else:
    print('No')

Solution (Python):



def main():
    s = input()
    n = len(s)
    i = 0
    j = n - 1
    while i < j:
        if s[i] != s[j]:
            print("No")
            return
        i += 1
        j -= 1
    i = 0
    mae_last = (n - 1) // 2 - 1
    usiro_first = (n + 3) // 2 - 1
    while i < mae_last:
        if s[i] != s[mae_last]:
            print("No")
            return
        i += 1
        mae_last -= 1
    i = n - 1
    while i > usiro_first:
        if s[usiro_first] != s[i]:
            print("No")
            return
        i -= 1
        usiro_first += 1
    print("Yes")


if __name__ == '__main__':
    main()

Solution (Python):
A=input()
B=A[0:len(A)//2]

if A!=A[::-1]:
  print("No")

else:
  if B!=B[::-1]:
    print("No")
  else:
    print("Yes")

Solution (Python):
s = input()

first = s[:int((len(s)-1)/2)]
last  = s[int((len(s)+2)/2):]

isOK = True

for i in range(int(len(first)/2)):
    if first[i] != first[len(first)-i-1]:
        isOK = False
    
    if last[i] != last[len(last)-i-1]:
        isOK = False

    if first != last:
        isOK = False

if isOK:
    print('Yes')
else:
    print('No')

Solution (Python):
def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True

s = str(input())

if is_kaibun(s):
    if is_kaibun(s[0:int((len(s)-1)/2)]):
        if is_kaibun(s[int((len(s)+3)/2):len(s)-1]):
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Solution (Python):
S = input()
N = len(S)

if S[::-1] != S:
    print("No")
    exit()

ss = S[:(N - 1) // 2]

if ss[::-1] != ss:
    print("No")
    exit()

sss = S[(N + 3) // 2 - 1:]

if sss[::-1] != sss:
    print("No")
    exit()

print("Yes")

Solution (Python):
S=input()
n=len(S)
t=S[0:int((n-1)/2)]
u=S[int((n+1)/2):]
if S==S[::-1] and t==t[::-1] and u==u[::-1]:
  print('Yes')
else:
  print('No')

Solution (Python):
def ispalindrome(str): return 1 if str == str[::-1] else 0


def solve():
    S = input()
    N = len(S)
    if ispalindrome(S):
        left = S[:int(((N-1)/2))]
        if ispalindrome(left):
            right = S[int(((N+3)/2)-1):]
            if ispalindrome(right):
                print("Yes")
                exit()

    print("No")



if __name__ == "__main__":
    solve()

Solution (Python):


s = input()
n = len(s)

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

            return False
    return True

if cond1(s[:((n-1)//2)]) and cond1(s[(n+3)//2-1:]) and cond1(s):
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()

def kaibun_check(s):
    n = len(s)
    zenhan_s = s[:int((n - 1)/2)]
    zenhan = zenhan_s == zenhan_s[::-1]
    kouhan_s = s[int((n + 1)/2):]
    kouhan = kouhan_s == kouhan_s[::-1]
    return zenhan and kouhan and (s == s[::-1])

print("Yes" if kaibun_check(s) else "No")

Solution (Python):
S = input()
n = len(S)
p = (n-1)//2
q = (n+3)//2 - 1
A = S[:p]
B = S[q:]
ans = 'Yes'
for i in range(len(S)):
    if S[i] != S[-i-1]:
        ans = 'No'
for i in range(len(A)):
    if A[i] != A[-i-1]:
        ans = 'No'
for i in range(len(B)):
    if B[i] != B[-i-1]:
        ans = 'No'
print(ans)

Solution (Python):



s = input()
c = 0
for i in range((len(s) - 1)// 2):
    if s[i] == s[-1 - i] and s[i] == s[(len(s) - 1)// 2 - 1 - i]:
        pass
    else:
        c += 1
        break

if c == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
s=input()
k=s[::-1]
c=0
if s==k:
    c+=1
f=((len(s)-1)//2)

s1=s[0:f]

s1p=s1[::-1]
if s1==s1p:
    c+=1
f1=(((len(s)+3)//2)-1)
s2=s[f1:]

s2p=s2[::-1]
if s2==s2p:
    c+=1
if c==3:
    print('Yes')
else:
    print('No')

Solution (Python):
def is_palindrome(s):
    len_s = len(s)
    ans = True
    for i in range(len_s // 2):
        if s[i] != s[-(i + 1)]:
            ans = False
    return ans

s = input()
len_s = len(s)
ans = True
if is_palindrome(s) == False:
    ans = False
if is_palindrome(s[0:(len_s - 1) // 2]) == False or is_palindrome(s[(len_s + 1) // 2:len_s]) == False:
    ans = False
if ans:
    print('Yes')
else:
    print('No')

Solution (Python):
S = input()

strong = True
N = len(S)

for i in range(int((N-1)/2)):
    if S[i] != S[-i-1]:
        strong = False

tmp = S[:int((N-1)/2)]
for i in range(int(len(tmp)-1/2)):
    if tmp[i] != tmp[-i-1]:
        strong = False


tmp = S[int((N+3)/2)-1:]
for i in range(int(len(tmp)-1/2)):
    if tmp[i] != tmp[-i-1]:
        strong = False

if strong:
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
n = len(s)
ans = True

for i in range((n-1)//2):
    head = i
    tail = ((n-3)//2) - i

    
    if s[head] != s[tail]:
        ans = False
        
    head2 = i + (n+1)//2
    tail2 = - i + n - 1
    if s[head2] != s[tail2]:
        ans = False
        
    if s[head] != s[tail2] or s[tail] != s[head2]:
        ans = False
        
    if ans == False:
        break
    
if ans:
    print('Yes')
else:
    print('No')

Solution (Python):
def palindrom(st):
    return st == st[::-1]
import math
s = input()
l = len(s)
print("Yes" if palindrom(s) and palindrom(s[:(l-1)//2]) and palindrom(s[(l+2)//2:]) else "No")

Solution (Python):
S = input()

def check_palindrome(txt):
  return txt == ''.join(list(txt)[::-1])

ep1 = len(S) // 2
txt1 = S[0:ep1]

sp2 = len(S) // 2 + 1
txt2 = S[sp2:]

if check_palindrome(S):
  if check_palindrome(txt1):
    if check_palindrome(txt2):
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Solution (Python):
S=input()
r=S[::-1]
N=len(S)
print('YNeos'[not(S==r and S[:(N-1)//2]==S[:(N-1)//2][::-1] and S[(N+3)//2-1:]==S[(N+3)//2-1:][::-1])::2])

Solution (Python):
S = str(raw_input())
N = len(S)

rev = S[::-1]
S1 = S[:(N-1)/2]
S2 = S[(N+1)/2:]

if (rev == S and S1[::-1] == S[:(N-1)/2] and S2[::-1] == S[(N+1)/2:]):
    print("Yes")
else:
    print("No")

Solution (Python):
import sys

s = input()
r_s = s[::-1]
if(r_s != s):
    print('No')
    sys.exit()

n = (len(s)-1)//2
s_slice = s[0:n]
r_s_slice = s_slice[::-1]
if(s_slice != r_s_slice):
    print('No')
    sys.exit()

n = len(s)
s_3 = s[(n+3)//2 -1:]
r_s_3 = s_3[::-1]

if(s_3 != r_s_3):
    print('No')
    sys.exit()

print('Yes')

Solution (Python):
S = str(input())
x = int((len(S)-1)/2)
if S[:x] == S[-x:]:
    print('Yes')
else:
    print('No')

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

from decimal import *

























def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

inf = float('inf')
mod = 1000000007




def main():
	S = input()
	S = S[:-1]

	if kai(S) == True:
		tmp = len(S)
		tmp = (tmp -1) // 2
		if kai(S[:tmp]) == True:
			tmp = len(S)
			tmp = (tmp +3) // 2
			
			if kai(S[tmp-1:]) == True:

				print("Yes")
				sys.exit()
	print("No")







def kai(s):
	flg = True
	tmp = len(s)
	tmp = tmp //2

	for i in range(tmp):
		ii = (-1 * i) + -1
		if s[i] != s[ii]:
			flg = False
	return flg

def int_sqrt2(n):
    def f(prev):
        while True:
            m = (prev + n / prev) / 2
            if m >= prev:
                return prev
            prev = m

    return f(int(math.sqrt(n) * (1 + 1e-10)))



def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res


def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y



def H(n, r, mod=10**9+7):
	
	
    return combination(n+r-1, r, mod)

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        
        
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

if __name__ == "__main__":
	main()

Solution (Python):
def isKaibun(str):
  result = True
  for i in range(len(str)-1//2):
    if str[i] != str[-i-1]:
      result = False
      break
  return result

S = input().strip()

result = 'No'
N = len(S)
"""
print(S[0:(N-1)//2])
print(isKaibun(S[0:(N-1)//2]))
print(S[(N+3)//2-1::])
print(isKaibun(S[(N+3)//2-1::]))
"""
if isKaibun(S) and isKaibun(S[0:(N-1)//2]) and isKaibun(S[(N+3)//2-1::]):
  result = 'Yes'
print(result)

Solution (Python):
S=list(input())
SV=S[::-1]
N=len(S)

for i in range(N):
    F=1
    if S[i]!=SV[i]:
        F=0
        break

s=S[:N//2]
sv=s[::-1]
n=len(s)

for i in range(n):
    FF=1

    if s[i]!=sv[i]:
        FF=0
        break

if F and FF:
    print('Yes')
else:
    print('No')

Solution (Python):
S = input()
l = len(S)
fl = (l-1)//2
sl = (l+3)//2 - 1
f = S[:fl]
s = S[sl:]
if f == f[::-1] and s == s[::-1] and S == S[::-1]:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
n = len(s)//2
if s[:n] == s[:n][::-1] and s[n+1:] == s[n+1:][::-1] and s == s[::-1]:
    print('Yes')
else:
    print('No')

Solution (Python):
s=input()
n=len(s)
A=s[0:(n-1)//2]
B=s[(n+3)//2-1:n]
if s==s[::-1]:print("Yes" if A==A[::-1] and B==B[::-1] else "No")
else:print("No")

Solution (Python):
s = input()
f = s[:len(s)//2]
g = s[len(s)//2 + 1:]
if f == f[::-1] and g == g[::-1] and s == s[::-1]:
  print('Yes')
else:
  print('No')

Solution (Python):
import sys

s = input()
half = int( (len(s)-1) / 2 ) + 1


for i in range( half-1 ):
  if s[i] != s[-i-1]:
    print('No')
    sys.exit()
  
s1 = s[:half-1]
s2 = s[half:]


if s1 == s2:
  print('Yes')
else:
  print('No')

Solution (Python):
S = input()

N = len(S)
S_list = [i for i in S]
check = 0

S_0 = S_list
for i in range(len(S_0)//2):
    if S_0[i] != S_0[-(i+1)]:
        check = 1

S_1 = S_list[:(N-1)//2]
for i in range(len(S_1)//2+1):
    if S_1[i] != S_1[-(i+1)]:
        check = 1

S_2 = S_list[(N+3)//2-1:]
for i in range(len(S_2)//2+1):
    if S_2[i] != S_2[-(i+1)]:
        check = 1

if check == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
def kaibun(s):
    

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

def main():
    S = input()
    N = len(S)
    if kaibun(S) == False:
        
        print('No')
        return

    if kaibun(S[0:(N-1)//2]) == False:
        
        print('No')
        return
    if kaibun(S[(N+3)//2 - 1:N]) == False:
        
        print('No')
        return

    print('Yes')

if __name__ == '__main__':
    main()

Solution (Python):
s=input()
n=len(s)
if not s[0:(n-1)//2]==s[(n+1)//2:n]:
  print('No')
elif s==s[::-1]:
	print('Yes')
else:
	print('No')

Solution (Python):
s=input()
front=[]
back=[]
ans="Yes"
for i in range((len(s)-1)//2):
  front.append(s[i])
for i in range((len(s)+3)//2-1,len(s)):
  back.append(s[i])
back.reverse()
if front!=back:
  ans="No"

fro=[]
bac=[]
if len(front)%2!=0 and len(front)!=1:
  for i in range((len(front)-1)//2):
    fro.append(front[i])
  for i in range((len(front)+3)//2-1,len(front)):
    bac.append(front[i])
  bac.reverse()
  if fro!=bac:
    ans="No"
elif len(front)%2==0:
  for i in range(len(front)//2):
    fro.append(front[i])
  for i in range(len(front)//2,len(front)):
    bac.append(front[i])
  bac.reverse()
  if fro!=bac:
    ans="No"

print(ans)

Solution (Python):
import math
import re


x=input()

n=len(x)

k=int((n-1)/2)

y=int((n+3)/2)

x1=x[::-1]

x2=x[:k]


x3=x2[::-1]

x4=x[y-1:]
x5=x4[::-1]


if (x1==x)and(x3==x2)and(x4==x5):
    print('Yes')
else :
    print('No')

Solution (Python):
S=input()
k=0
d=0
p=0
for i in range(0,len(S)):
    if S[i]==S[len(S)-i-1]:
        k=k
    else:
        k=k+1
for i in range (0,(len(S)-1)//2):
    if S[i]==S[(len(S)-1)//2-i-1]:
        d=d
    else:
        d=d+1
for i in range (0,(len(S)-1)//2):
    if S[(len(S)+3)//2+i-1]==S[len(S)-i-1]:
        p=p
    else:
        p=p+1
if k>0 or d>0 or p>0:
    print('No')
else:
    print('Yes')

Solution (Python):
import sys
import math
from functools import reduce
from operator import mul
sys.setrecursionlimit(10**6)

def InMap(): return list(map(int, sys.stdin.readline().split(' ')))
def In(): return int(sys.stdin.readline())
def InS(): return sys.stdin.readline()

S = InS()[:-1]

N = len(S)
T = S[:(N-1)//2]
if S[:(N-1)//2] == T[::-1]:
    T2 = S[(N+1)//2::]
    if S[(N+1)//2::] == T2[::-1]:
        if T == T2[::-1]:
            print('Yes')
            sys.exit()

print('No')

Solution (Python):
s = input()
n = s.__len__()
hn = ((n - 1) / 2).__int__()
qn = (hn / 2).__int__()
ans = 'Yes'
for i in range(hn):
    if s[i] != s[n-1-i]:
        ans = 'No'
for i in range(qn):
    if s[i] != s[hn-1-i]:
        ans = 'No'
print(ans)

Solution (Python):
S=str(input())
def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return print('No')
    for j in range(len(kaibun)//4):
        if kaibun[j] != kaibun[-(j+len(kaibun)//2)-2]:
            return print('No')
        if kaibun[j+len(kaibun)//2+1] != kaibun[-(j+len(kaibun)//2)-2]:
            return print('No2')
    return print('Yes')

is_kaibun(S)

Solution (Python):
s = str(input())
n = int(len(s))
out = 'Yes' if s == s[::-1] and s[:int((n - 1)/2)] == s[:int((n - 1)/2)][::-1] \
               and s[int((n + 3)/2) - 1:n] == s[int((n + 3)/2) - 1:n][::-1] else 'No'
print(out)

Solution (Python):
S = input()
N = len(S)
end = int((N-1)/2)
start = int( (N+3)/2)-1

ans  = 'No'
if S == S[::-1]:
    if S[:end] == S[:end][::-1]:
        if S[start:] == S[start:][::-1]:
            ans = 'Yes'
print(ans)

Solution (Python):
import sys

s = input()

n = len(s)

n1 = int(n/2)

for i in range(n1):
    if s[i] == s[-1-i]:
        pass
    else:
        print('No')
        sys.exit()

n2 = int((n-1)/2) - 1

for i in range(n2):
    if s[i] == s[n2-i]:
        pass
    else:
        print('No')
        sys.exit()

n3 = int((n+3)/2)

diff = n-n3

n3 -= 1
n  -= 1

diff = int(diff/2)

for i in range(diff):
    if s[n3+i] == s[n-i]:
        pass
    else:
        print('No')
        sys.exit()

print('Yes')

Solution (Python):
s = input()
n = len(s)

sr = s[::-1]

s2 = s[:int((n-1)/2)]

s2r = s2[::-1]

s3 = s[int((n+3)/2)-1:n]

s3r = s3[::-1]

if (s == sr) and (s2 == s2r) and (s3 == s3r):
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()
l = len(s)
i = 0
j = l-1
f = 0
while i<j:
	if s[i] != s[j]:
		f = 1
		break
	i += 1
	j -= 1
if f==0:
	i = 0
	j = (l-2)//2
	while i<j:
		if s[i] != s[j]:
			f = 1
			break
		i += 1
		j -= 1
if f==0:
	print("Yes")
else:
	print("No")

Solution (Python):
s = input()

n = len(s)

kai = str()
for i in range(n):
    kai = kai + s[n-1-i]

strong = 0

if kai == s:
    strong = strong + 1

nf = int(((n-1)/2)-1)

kaif = str()
for i in range(nf):
    kaif = kaif + s[nf-i]

if kaif == s[0:nf]:
    strong = strong + 1

ns = int((n+3)/2)

kais = str()
for i in range(n-ns):
    kais = kais + s[n-i-1]

if kais == s[ns-1:n-1]:
    strong = strong + 1

if strong == 3:
    print("Yes")
else:
    print("No")

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

    n = len(s)
    if not isPalindrome(s):
        print('No')
        return
    if not isPalindrome(s[:(n-1)//2]):
        print('No')
        return
    if not isPalindrome(s[(n+3)//2 - 1:]):
        print('No')
        return
    print('Yes')

s = input()
solve(s)

Solution (Python):
def x(S):
	SS = ""
	for i in range(len(S)):

		SS += S[(i+1)*-1]
	return  SS == S

S1 = input()
N1 = len(S1)

N2 = (N1 - 1) // 2
N3 = (N1 + 3) // 2
S2 = S1[0:N1]
S3 =S1[N3-1:N1]
if x(S1) and x(S2) and x(S3):
	print("Yes")
else:
	print("No")

Solution (Python):

s = input()

answer = "No"

s1= s[:int((len(s)-1)/2)]
s2 = s[int((len(s)+3)/2)-1:]
def check(s): return True if s == s[::-1] else False
if check(s) and check(s1) and check(s2):
    answer = "Yes"
print(answer)

Solution (Python):
S = input()

def check(S):
    N = len(S)
    for i in range(N):
        if S[i] != S[N - i - 1]:
            return False
    return True

if check(S) and check(S[0:int(len(S) / 2)]):
    print('Yes')
else:
    print('No')

Solution (Python):
s=input()

if s == s[::-1]:
    if s[0:(len(s)-1)//2] ==s[0:(len(s)-1)//2][::-1]:
        if s[(len(s)+2)//2:] == s[(len(s)+2)//2:][::-1]:
            print("Yes")
            exit()
print('No')