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):
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

S = S()
N = len(S)
T = S[0:(N - 1) // 2]
U = S[(N + 3) // 2 - 1:N]
if S == S[::-1] and T == T[::-1] and U == U[::-1]:
    print('Yes')
else:
    print('No')

Solution (Python):
S=input()
N=len(S)
l=(N-1)//2
for i in range(l):
  if S[i]!=S[N-1-i]:
    print('No')
    exit()
L=S[:l]
for i in range(l):
  if S[i]!=S[l-1-i]:
    print('No')
    exit()
print('Yes')

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

Solution (Python):
s = input()
p ="Yes"
for i in range(len(s)//2):
  if s[i] != s[len(s) -1 -i]:
    p = "No"
for i in range(len(s)//2):
  if s[i] != s[len(s)//2 -1 -i]:
    p = "No"
print(p)

Solution (Python):
s1 = input()
s1r = s1[::-1]
n1 = len(s1)
s2 = s1[:(n1-1)//2]
s2r = s2[::-1]
s3 = s1[-(n1-1)//2:]
s3r = s3[::-1]
if s1 == s1r and s2 == s2r and s3 == s3r:
    print('Yes')
else:
    print('No')

Solution (Python):
s1 = input()
n1 = len(s1)
s2 = s1[:(n1-1)//2]
n2 = len(s2)
s3 = s1[-(n1-1)//2:]
n3 = len(s3)
f1, f2, f3 = True, True, True
for i in range((n1-1)//2):
    if s1[i] != s1[-i-1]:
        f1 = False
        break
for i in range(n2//2):
    if s2[i] != s2[-i-1]:
        f2 = False
        break
for i in range(n3//2):
    if s3[i] != s3[-i-1]:
        f3 = False
        break
if f1 and f2 and f3:
    print('Yes')
else:
    print('No')

Solution (Python):

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

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

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

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

Solution (Python):
s = input()
n = len(s)
n1 = (n-1)//2
n2 = (n+1)//2

if s == s[::-1]:
    if s[:n1] == s[n2:]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

def kaibun(s):
    n = len(s)
    f_kaibun = True
    for i in range(int(n/2)):
        j = n-1-i
        if j <= i:
            break
        if s[i] != s[j]:
            f_kaibun = False
            break
    return f_kaibun

if kaibun(S) and kaibun(S[0:int(round((N-1)/2))]) and kaibun(S[int(round((N+3)/2))-1:N]):
    print('Yes')
else:
    print('No')

Solution (Python):
s = str(input())
n = len(s)
z = 'Yes'
for i in range(n//2):
    if s[i] != s[-1-i]:
        z = 'No'
if z == 'Yes':
    for h in range(len(s[:(n-1)//2])):
        if s[:(n-1)//2][h] != s[:(n-1)//2][-1-h]:
            z = 'No'
            break
if z == 'Yes':
    for j in range(len(s[((n+3)//2)-1:])):
        if s[((n+3)//2)-1:][j] != s[((n+3)//2)-1:][-1-j]:
            z = 'No'
            break
print(z)

Solution (Python):
if __name__ == '__main__':

    s = input()
    
    cnt = 0
    
    r = s[::-1]
    if s == r:
        cnt += 1

    
    n = len(s)
    n2 = (n-1)//2
    ss = s[:n2]
    rr = ss[::-1]
    if ss == rr:
        cnt += 1

    
    n3 = (n+3) //2
    sss = s[n3-1:]
    rrr = sss[::-1]
    if sss == rrr:
        cnt += 1

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

Solution (Python):

def main():
    S = input()

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


if __name__ == '__main__':
    main()

Solution (Python):

def main():
    S = input()

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


if __name__ == '__main__':
    main()

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

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

Solution (Python):
import copy
a = list(input())
if len(a) == 5:
  print("No")
  exit()
else:
  b = copy.copy(a)
  b.reverse()
  x = int((len(a)/2))
  for i in range(x):
    if a[i] != b[i]:
      print("No")
      exit()
  c = a[:x]
  d = a[x+1:]
  y = int((len(c)/2))
  for i in range(y):
    if c[i] != c[-(i+1)] or d[i] != d[-(i+1)]:
      print("No")
      exit()
  print("Yes")

Solution (Python):
s = input()
n = len(s)
cnt = 0
s1 = s[:((n-1)//2)]
s2 = s[(n+3)//2 -1:n]

for i in range(n//2):
    if s[i] != s[-i-1]:
        print('No')
        exit()
    else:
        if s1[i] != s2[i]:
            print('No')
            exit()
print('Yes')

Solution (Python):
import sys
S = input()
if S == 'level':
    print('No')
    sys.exit()


for i in range((len(S)//2)-1):
    if S[i] != S[len(S)-1-i]:
        print('No')
        sys.exit()
       
for j in range((len(S)//4)-1):
    if S[j] != S[(len(S)//2)-j-1]:
        print('No')
        sys.exit()

for k in range((len(S)//4)-1):
    if S[(len(S)//2)+1+k] != S[len(S)-k-1]:
        print('No')
        sys.exit()

print('Yes')

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

def func():
    if n == 3 and s[0] == s[2]:
        return"Yes"
    else:
        a = 0
        for i in range(n//2):
            if s[i] == s[n - 1 - i]:
                a += 1
                if a == n//2:
                    b = 0
                    for j in range((n-1)//4):
                        if s[j] == s[(n-1)//2 - 1 - j]:
                            b += 1
                            if b == (n-1)//4:
                                c = 0
                                for k in range((n - (n+3)//2 + 1)//2):
                                    if s[(n+3)//2 - 1 + k] == s[n - 1 - k]:
                                        c += 1
                                        if c == (n - (n+3)//2 + 1)//2:
                                            return "Yes"
                        else:
                            return "No"
            else:
                return "No"
        
print(func())

Solution (Python):


def main():
    s = input()
    n = len(s)
    s1 = s[:int((n-1)/2)]
    s2 = s[int((n+3)/2)-1:]
    
    for tmp in [s, s1, s2]:
        tmp_rev = tmp[::-1]
        
        if tmp != tmp_rev:
            print("No")
            break
    else:
        print("Yes")
    
main()

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

Solution (Python):
S = input()
N = len(S)
T = S[:(N-1)//2]
U = S[(N+3)//2-1:]

if S==S[::-1] and T == T[::-1] and U == U[::-1]:
  print("Yes")
  
else:
  print("No")

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

Solution (Python):
s = input()
n = len(s)
entire = s == s[::-1]
left = s[:int((n-1)/2)] == s[:int((n-1)/2)][::-1]
right = s[int((n+3)/2-1):] == s[int((n+3)/2-1):][::-1]
if entire and left and right:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()

def check():
  if s != s[::-1]:
    return("No")
  n = len(s)
  s1 = s[:int((n-1)/2)]
  
  if s1 != s1[::-1]:
    return("No")
  s2 = s[int((n+3)/2-1):]
  if s2 != s2[::-1]:
    return("No")
  
  return("Yes")

print(check())

Solution (Python):
def main():
    s = input()
    s1 = s[:int((len(s)-1)/2)]
    s2 = s[int((len(s)+3)/2-1):]
    rs = s[::-1]
    rs1 = s1[::-1]
    rs2 = s2[::-1]


    if s1 == rs1 and s2 == rs2 and s == rs:
        print("Yes")
    else:
        print("No")
    
    return
    
main()

Solution (Python):
S = input()
N = len(S)
S_list=[]
for i in S:
    S_list.append(i)   
rS_list = list(reversed(S_list))
second_list = S_list[:(int((N-1)/2))]

rsecond_list = list(reversed(second_list))
third_list = S_list[(int(((N+3)-1)/2)):N]

rthird_list = list(reversed(third_list))
if S_list == rS_list:
    
    if second_list == rsecond_list:
        
        if third_list == rthird_list:
            
            print('Yes')       
    else:
            print('No')   
else:
            print('No')

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

Solution (Python):
import sys
S=input()
N=len(S)
if S[:N//2]==S[N//2+1:][::-1]:
  if N==3:
    print("Yes")
  elif (N//2)%2==1:
    if S[:(N//2)//2]==S[(N//2)//2+1:N//2][::-1] and S[N//2+1:-(N//2)//2]==S[-(N//2)//2+1:][::-1]:
      print("Yes")
    else:

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

  print("No")

Solution (Python):
s=input()

if s==s[::-1]:
  if s[:(len(s)-1)//2] == s[:(len(s)-1)//2:-1]:
    ss=s[(len(s)+3)//2-1:len(s)]
    if ss ==  ss[::-1]:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

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


subS1 = S[:int((N - 1) / 2)]
subS2 = S[int((N + 3) / 2) - 1:]

if subS1 == subS1[::-1] and subS2 == subS2[::-1] and S == S[::-1]:
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
n = len(s)
s_r = list(reversed(s))

cnt0 = 0
ss0 = False
for a,b in zip(s,s_r):
    if a == b:
        cnt0 += 1
    if cnt0 == len(s):
        ss0 = True

cnt1 = 0
ss1 = False
s1 =s[0:(n-1)//2]
s1_r = list(reversed(s1))
for a,b in zip(s1,s1_r):
    if a == b:
        cnt1 += 1
    if cnt1 == len(s1):
        ss1 = True
        
cnt2 = 0
ss2 = False
s2 =s[(n+3)//2-1:n]
s2_r = list(reversed(s2))
for a,b in zip(s2,s2_r):
    if a == b:
        cnt2 += 1
    if cnt2 == len(s2):
        ss2 = True
        
if ss0 and ss1 and ss2:
    print("Yes")
else:
    print("No")

Solution (Python):


S = input()
n = len(S)
n
m = int(((n - 1)/2)-1)
l = int(((n + 3)/2)-1)

if S[::1] == S[::-1]:
        if S[:m+1:] == S[m::-1]:
            if S[l::] == S[:l-1:-1]:
                print('Yes')
                exit()
print('No')

Solution (Python):
S=str(input())
n=len(S)
Srev=''.join(list(reversed(S)))
S1=S[0:(n-1)//2]
S2=S[((n+1)//2):n]
S1rev=''.join(list(reversed(S1)))
S2rev=''.join(list(reversed(S2)))
if S==Srev and S1==S1rev and S2==S2rev:
    print('Yes')
else:
    print('No')

Solution (Python):

import sys
input = lambda: sys.stdin.readline().strip()
def pal(s, L, R):
    return s[L] == s[R] and (L >= R or pal(s, L + 1, R - 1))

s = input()
n = len(s)
print('Yes' if pal(s, 0, n - 1) and pal(s, 0, (n - 1) // 2 - 1) and pal(s, (n + 3) // 2 - 1, n - 1) else 'No')

Solution (Python):

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

S = input()
N = len(S)
ans = ['No', 'Yes'][is_palindrome(S) & is_palindrome(S[:((N-1)//2)]) & is_palindrome(S[((N+1)//2):])]
print(ans)

Solution (Python):
S = input()
N = len(S)
S1 = S[0:(N-1)//2]
S2 = S[(N+3)//2-1:N]
print("Yes" if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1] else "No")

Solution (Python):
w = input()
l = len(w)
flag = True
for i in range((l - 1)//2):
  if w[i] != w[l - i - 1]:
    flag = False
    break
mid = (l - 1) // 2
mid_mid = mid // 2
for i in range(mid_mid + 1):
  if w[i] != w[mid - i - 1] or not flag:
    flag = False
    break
  if w[i + mid + 1] != w[l - i - 1]:
    flag = False
    break
if flag:
  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]
c=a[::-1]
d=b[::-1]
sr=s[::-1]
for i in range(n):
    if s[i]==sr[i]:
        pass
    else:
        print("No")
        exit()
for i in range(len(a)):
    if a[i]==c[i]:
        pass
    else:
        print("No")
        exit()
for i in range(len(b)):
    if b[i]==d[i]:
        pass
    else:
        print("No")
        exit()
print("Yes")

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

if s == s[::-1]:
    flag += 1

ss = s[:int((n-1)/2)]
if ss == ss[::-1]:
    flag += 1

sss = s[int((n+3)/2)-1:]
if sss == sss[::-1]:
    flag += 1

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

Solution (Python):
S=input()
N=len(S)
def isKaibun(S):
  
  if S==S[::-1]:
    return True
  return False
if isKaibun(S) and isKaibun(S[:(N-1)//2]) and isKaibun(S[(N+3)//2-1:]):
  print("Yes")
else:
  print("No")

Solution (Python):
def solve():
    S = input()
    if S != S[::-1]:
        print("No")
    else:
        sub = S[:(len(S)-1)//2]
        if sub != sub[::-1]:
            print("No")
        else:
            print("Yes")

if __name__ == "__main__":
    solve()

Solution (Python):
S = input()

s1 = S[0:int((len(S)-1)/2)]
s2 = S[int((len(S)/2))+1:len(S)+1]
if S == S[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
    print("Yes")
else:
    print("No")

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

Solution (Python):
def main():
  s=input()
  x=s[:int((len(s)-1)/2)]
  y=s[int((len(s)+3)/2)-1:]
  flg=0
  
  if s !=s[::-1]:
    flg=1
  if x !=x[::-1]:
    flg=1
  if y !=y[::-1]:
    flg=1
  if flg==1:
    print("No")
  else:
    print("Yes")
main()

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

Solution (Python):
def kaibun(lst):
    k = len(lst)//2 + len(lst)%2
    for i in range(1,k+1):
        if lst[i-1] != lst[-i]:
            return False

    return True
S = list(input())
N = len(S)
if kaibun(S) and kaibun(S[:(N-1)//2]) and kaibun(S[(N+3)//2-1:]):
    print('Yes')

else:
    print('No')

Solution (Python):
s=str(input())
n=len(s)
x=s[:(n-1)//2]
y=s[(n+3)//2-1:]
ans=0

for i in range(3):
    if s==s[::-1]:
        ans +=1

    if i==0:
        s=x
    elif i==1:
        s=y

print("Yes" if ans==3 else "No")

Solution (Python):
s = input()

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

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

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

print("Yes")

Solution (Python):
word = input()
n = len(word)
hanbun = int((n-1)/2)
notk = 0
for i in range(hanbun):
    if word[i] != word[n-i-1]:
        notk = 1
        break
        
if hanbun % 2 == 0:
    hanbun2 = int(hanbun/2)
else:
    hanbun2 = int((hanbun-1)/2)
    
for j in range(hanbun2):
    if word[j] != word[hanbun-j-1]:
        notk = 1
        break

if notk == 1:
    print('No')
else:
    print('Yes')

Solution (Python):
S = input()
count = 0
N = len(S)
a = int((N-1)/2 )
b = int((N +3)/2)
if S[:a] ==S[b-1:]:
  pass
else:
  count +=1
SS = S[b-1:]

SSS =list(SS)
for i in range(len(SSS)):
  if SSS[i] != SSS[-i-1]:
    
    count +=1
if count==0:
  print('Yes')

else:
  print('No')

Solution (Python):
S=input()
N=len(S)
SH=S[:(N-1)//2]
ST=S[(N+3)//2-1:]
p=False
if SH==SH[::-1] and SH==ST:
  p=True
print("Yes" if p else "No")

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

S_1 = S[0:int((N-1)/2)]
S_2 = S[int((N+3)/2-1):N+1]

print('Yes' if S[::-1] == S and S_1[::-1] == S_1 and S_2[::-1] == S_2 else 'No')

Solution (Python):
s = input()
n = len(s)
s1 = s[:(n-1)//2]
s2 = s[((n+3)//2)-1:]

def kaibun(S):
  for i,j in zip(S,S[::-1]):
    if i!=j:
      return False
  return True

if kaibun(s) and kaibun(s1) and kaibun(s2):
  print('Yes')
else:
  print('No')

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

Solution (Python):

def isPalindrome(str):
  ret = True
  l = len(str)
  end = int(l/2)
  for i in range(end):
    if str[i] != str[-1-i]:
      ret = False
	
  return ret

ans = "Yes"
str = input()

str_l = len(str)
if isPalindrome(str) and isPalindrome(str[:int(str_l/2)]) and isPalindrome(str[-int(str_l/2):]):
  print("Yes")
else:
  print("No")

Solution (Python):
def check(str):
    str2 = str[::-1]
    return str == str2



def main():
    s = input()
    n = len(s)
    first = s[:(n-1)//2]
    end = s[((n+3)//2)-1:]
    if all((check(s), check(first), check(end))):
        print("Yes")
    else:
        print("No")

main()

Solution (Python):
S=input()
L=(len(S)-1)//2
ans='Yes'
if S[:L]!=S[-L:]:
    ans='No'
for n in range(L):
    m=L-1-n
    if S[n]!=S[m]:
        ans='No'
print(ans)

Solution (Python):
a=input()

b=len(a)

c=(b-1)/2

d=(b+1)/2

if a[:int(c)]==a[int(d):]:

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

Solution (Python):
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools

def main():
    s = list(input().rstrip())
    n = len(s)
    h = n//2
    f = s[:h]
    l = s[h+1:]
    if s == s[::-1] and f == f[::-1] and l == l[::-1]:
        print("Yes")
    else:
        print("No")

if __name__=="__main__":
    main()

Solution (Python):
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools

def main():
    s = list(input().rstrip())
    n = len(s)
    k = s.copy()
    k.reverse()
    if k != s:
        print("No")
        exit()
    k = s[0:(n-1)//2]
    l = k.copy()
    l.reverse()
    if k != l:
        print("No")
        exit()
    k = s[(n-1)//2+1:]
    l = k.copy()
    if k != l:
        print("No")
        exit()
    print("Yes")

if __name__=="__main__":
    main()

Solution (Python):
def CheckPalindrome(S, L):
    result = True
    for i in range((L+1)//2):
        if S[i] != S[-i-1]:
            result = False
            break
    return result

result = True
S = input()
L = len(S)

result = CheckPalindrome(S, L)

if result:
    S2 = S[:(len(S)-1) // 2]
    L2 = len(S2)
    result = CheckPalindrome(S2, L2)

if result:
    S3 = S[(L+3)//2-1:]
    L3 = len(S3)
    result = CheckPalindrome(S3, L3)

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

Solution (Python):
def is_palindrome(text):
    l = len(text)
    for i in range(l // 2 if l % 2 == 0 else (l + 1) // 2):
        if text[i] != text[l - 1 - i]:
            return False
    return True

s = input()
q1 = is_palindrome(text=s)
q2 = is_palindrome(text=s[0:(len(s) - 1) // 2])
q3 = is_palindrome(text=s[(len(s) + 3) // 2 - 1:len(s)])
print("Yes" if q1 and q2 and q3 else "No")

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

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

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

if not is_palindrome(S):
    print('No')
    sys.exit()

if not is_palindrome(S[0:int((N - 1) / 2)]):
    print('No')
    sys.exit()

if not is_palindrome(S[int((N + 3) / 2 - 1):]):
    print('No')
    sys.exit()

print('Yes')

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

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

    cond = check(S)
    cond = cond and check(S[:L // 2])
    cond = cond and check(S[(L + 1) // 2:])

    print('Yes' if cond else 'No')


if __name__ == '__main__':
    main()

Solution (Python):
def is_p(s):
    return s == s[::-1]
s = input()
l = (len(s) - 1)//2
r = l + 1
print('Yes' if is_p(s) and is_p(s[:l]) and is_p(s[r:]) else 'No')

Solution (Python):

S = input()

def is_kaibun(s):
    l = len(s)
    
    
    if s[:int(l/2)] == s[:-(int(l/2))-1:-1]:
        return True
    else:
        return False

if is_kaibun(S):
    if is_kaibun(S[:int((len(S)-1)/2)]):
        if is_kaibun(S[int((len(S)+3)/2)-1:]):
            print('Yes')
            exit()
print('No')

Solution (Python):
def kaibun(moji):
    n = len(moji)
    for i in range(0,int(n/2)):
        if s[i]!=s[n-1-i]:
            return False
    return True

s = str(input())
n = len(s)
moji1 = int((n - 1) / 2)
moji2 = int((n + 3) / 2)


if kaibun(s) and kaibun(s[:moji1]) and kaibun(s[moji2-1:]):
    print('Yes')
else:
    print('No')

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

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

if S!=S[::-1]:
    flag=False
if S[:int((N-1)/2)]!=S[:int((N-1)/2)][::-1]:
    flag=False
print("Yes" if flag else "No")

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

if S!="".join(reversed(list(S))):
    flag=False
if S[:int((N-1)/2)]!="".join(reversed(list(S[:int((N-1)/2)]))):
    flag=False
print("Yes" if flag else "No")

Solution (Python):
S = input()
N = len(S)
flag = [0,0,0]


if S=="".join(reversed(list(S))):
    flag[0]=1
if S[:int((N-1)/2)]=="".join(reversed(list(S[:int((N-1)/2)]))):
    flag[1]=1
if S[int((N+3)/2)-1:]=="".join(reversed(list(S[int((N+3)/2)-1:]))):
    flag[2]=1
print("Yes" if flag==[1,1,1] else "No")

Solution (Python):
s = input()
n = len(s)
flg = True
for i in range(n//2):
    if s[i] != s[n-1-i]:
        flg = False
for i in range(n//4):
    if s[i] != s[n//2-1-i]:
        flg = False
print('Yes') if flg else print('No')

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

Solution (Python):
import sys


def is_palindrome(s):
    if len(s) % 2:
        a, b = s[:len(s) // 2], s[len(s) // 2 + 1:]
    else:
        a, b = s[:len(s) // 2], s[len(s) // 2:]
    return a == ''.join(reversed(b))


def resolve(in_):
    s = in_.readline().strip()
    ret = is_palindrome(s) and is_palindrome(s[:len(s) // 2]) and is_palindrome(s[len(s) // 2 + 1:])
    return 'Yes' if ret else 'No'


def main():
    answer = resolve(sys.stdin)
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
s = input()
n = len(s)
flag = 1
for i in range(int(n/2)):
    if s[i] != s[n-i-1]:
        flag = 0
        break
n2 = int((n-1)/2)
if flag == 1:
    for i in range(int(n2/2)):
        if s[i] != s[n2-i-1]:
            flag = 0
            break
if flag == 1:
    print("Yes")
else:
    print("No")

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

Solution (Python):
a=input()
c=len(a)
b=a[:(c-1)//2]
d=a[(c+3)//2-1:]
if a==a[::-1] and b==b[::-1] and d==d[::-1]:
  print("Yes")
else:
  print("No")

Solution (Python):
S=input()
N=len(S)
M=(N-1)//2
def iskaibun(T):
    K=len(T)
    for i in range(K):
        if T[i]==T[-i-1]:
            pass
        else:
            return False
    return True

if iskaibun(S) and iskaibun(S[:M]) and iskaibun(S[M+1:]):
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
s=input()
n=len(s)
n_1=int((n-1)/2)
n_2=int((n+1)/2)

s_1=s[:n_1]
s_2=s[n_2:]

if s==s[::-1] and s_1==s_1[::-1] and s_2==s_2[::-1]:
    print("Yes")
else:
    print("No")

Solution (Python):
def isPalindrome(st):
    l = len(st)
    c = l//2
    if l%2 == 1:
        return st[:c] == st[c+1:][::-1]
    else:
        return st[:c] == st[c:][::-1]

S = input()
N = len(S)

if isPalindrome(S) and isPalindrome(S[:(N-1)//2]) and isPalindrome(S[(N+3)//2 - 1:]):
    print('Yes')
else:
    print('No')

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

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

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

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

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



for i in range(int(N/2)):
    if(S[i] != S[N-1-i]):
        print("No")
        exit()

    if(S1[i] != S1[int(N/2)-1-i]):
        print("No")
        exit()

    if(S2[i] != S2[int(N/2)-1-i]):
        print("No")
        exit()

print("Yes")

Solution (Python):

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


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


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


def solve():
    S = input()
    N = len(S)

    if S != S[::-1]:
        return False

    t = S[:(N - 1) // 2]
    if t != t[::-1]:
        return False

    t = S[(N + 3) // 2 - 1:]
    if t != t[::-1]:
        return False

    return True


def main():
    if solve():
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Solution (Python):


from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')
YES = "Yes"  
NO = "No"  


def is_palindrome(s: str):
    return s[:len(s)//2] == s[::-1][:len(s)//2]


def solve(S: str):
    return [NO, YES][is_palindrome(S) and is_palindrome(S[:(len(S)-1)//2-1+1]) and is_palindrome(S[(len(S)+3)//2-1:])]


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    print(f'{solve(S)}')


if __name__ == '__main__':
    main()

Solution (Python):


from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')
YES = "Yes"  
NO = "No"  


def is_palindrome(s: str):
    return s[:len(s)//2] == s[::-1][:len(s)//2]


def solve(S: str):
    return [NO, YES][is_palindrome(S) and is_palindrome(S[:(len(S)-1)//2-1+1]) and is_palindrome(S[(len(S)+3)//2-1:])]


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    print(f'{solve(S)}')


if __name__ == '__main__':
    main()

Solution (Python):
S = input()
lenS = len(S)
ans = "No"

def checkPalindrome(string):
    l = len(string)
    string2 = string[::-1]
    if string[:l//2] == string2[:l//2]:
        return True
    else:
        return False

if checkPalindrome(S):
    if checkPalindrome(S[:(lenS-1)//2]):
        if checkPalindrome(S[(lenS+3)//2-1:]):
            ans = "Yes"

print(ans)

Solution (Python):



















































global FLAG_LOG
FLAG_LOG = False


def log(value):
    
    
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    S = lines[0]
    
    
    
    
    
    
    
    
    
    

    n = int((len(S)-1)/2)

    if is_kaibun(S) is not True:
        return ['No']
    if is_kaibun(S[:n]) is not True:
        return ['No']
    if is_kaibun(S[-n:]) is not True:
        return ['No']

    return ['Yes']


def is_kaibun(s):
    t = ''.join(list(reversed(s)))
    if s == t:
        return True
    else:
        return False



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['akasaka']
        lines_export = ['Yes']
    if pattern == 2:
        lines_input = ['level']
        lines_export = ['No']
    if pattern == 3:
        lines_input = ['atcoder']
        lines_export = ['No']
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

Solution (Python):






s = input()

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

if s == s[::-1]:
    if s1 == s1[::-1]:
        if s2 == s2[::-1]:
            print("Yes")
            exit()

print("No")

Solution (Python):
import numpy as np


def check_pali(S):
    for i in range(0, len(S)):
        if S[i] != S[-1 * i + -1]:
            return False

        elif i > (len(S) / 2) + 1:
            break

    return True


S = input()

N = len(S)

short_N = (N - 1) // 2
long_N = (N + 3) // 2


if check_pali(S) & check_pali(S[0:short_N]) & check_pali(S[long_N-1:N]):
    print("Yes")
else:
    print("No")

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

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

Solution (Python):
S = input()

s = list(S)
f = s[:int((len(s)-1)/2)]
l = s[int((len(s)+3)/2-1):]

if f == l:
    while len(f) > 1:
        if f[0] == f[-1]:
            f.pop(0)
            f.pop()
    if len(f) <= 1:
        while len(l) > 1:
            if l[0] == l[-1]:
                l.pop(0)
                l.pop()
        if len(l) <= 1:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')