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



Sample input:
akasaka


Sample output:
Yes

Submission status: Accepted

Solution code:
S=str(input())
N=len(S)
if S!=S[::-1]:#Sと反転したSが不一致
    print('No')
else:
    S1=S[0:(N-1)//2]#Sが1文字目～(N-1)/2番目の場合
    S2=S[(N+1)//2:N]#Sが(N+3)/2～N番目の場合
    if S1==S1[::-1] and S2==S2[::-1]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
S=input()
flag=0
if S==S[::-1]:
  s = S[:(len(S)-1)//2]
  if s==s[::-1]:
    s2 = S[(len(S)+3)//2-1:]
    if s2==s2[::-1]:
      flag=1
if flag:print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
def palindrome(S):
  for i in range(len(S)//2):
#    print(S[i],S[-(i+1)])
    if S[i] != S[-(i+1)]:
      return 0
  return 1
ans = "No"
S = input()
S1 = S[:(len(S)-1)//2]
S2 = S[(len(S)+1)//2:]
#print(palindrome(S))
#print(palindrome(S1))
#print(palindrome(S2))

if palindrome(S) == 1:
  if palindrome(S1) == 1:
    if palindrome(S2) == 1:
      ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

flg = is_kaibun(S) and is_kaibun(S[:len(S)//2]) and is_kaibun(S[:len(S)//2:-1])

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

t = s[0:(n-1)//2]
q = s[(n+2)//2:n]

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
s1=s[:(n-1)//2]
s2=s[n+3//2:]
def ispalindrome(str):
    if str==str[::-1]:
        s1=s[:(n-1)//2]
        if s1==s1[::-1]:
            s2=s[n+3//2:]
            if s2==s2[::-1]:
                return 'Yes'
            return 'No'
        return 'No'
    else:
        return 'No'
print(ispalindrome(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
a = (n - 1) // 2
b = (n + 3) // 2

judge = 1

for i in range(n // 2):
  if s[i] != s[-(i + 1)]:
    judge = 0
    break

if judge == 0:
  print('No')
else:
  al = s[:a]
  bl = s[b - 1:]
  for j in range(a // 2):
    if al[j] != al[-(j + 1)]:
      judge = 0
      break
  if judge == 0:
    print('No')
  else:
    for k in range((n - b) // 2):
      if bl[k] != bl[-(k + 1)]:
        judge = 0
        break
    if judge == 0:
      print('No')
    else:
      print('Yes')

Submission status: Accepted

Solution code:
s = input()
t = s[::-1]
n = len(s)
a = s[:(n - 1) // 2]
b = t[:(n - 1) // 2]

if s == t and a == a[::-1] and b == b[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
flag = 0
sr = s[-1::-1]
if sr == s:
    flag+=1
s1 = s[:(len(s)-1)//2]
s1r = s1[-1::-1]
if s1 == s1r:
    flag += 1
s2 = s[(len(s)+3)//2-1:]
s2r = s2[-1::-1]
if s2 == s2r:
    flag+=1
print('Yes' if flag == 3 else 'No')

Submission status: Accepted

Solution code:
import sys

S=input()
N=len(S)
if S!=S[::-1]:
  print("No")
  sys.exit(0)
check=S[0:int((N-1)/2)]
#print(check)
if check!=check[::-1]:
  print("No")
  sys.exit(0)
check=S[int((N+3)/2)-1:N]
#print(check)
if check!=check[::-1]:
  print("No")
  sys.exit(0)
print("Yes")

Submission status: Accepted

Solution code:
string = input()
mid = len(string)//2

gnirts = string[::-1]
if(string != gnirts or string[:mid] != gnirts[mid+1:] or string[mid+1:] != gnirts[:mid]):
  print("No")
  exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

s = list(s)
s1 = s[0:len(s)//2]
s2 = s[len(s)//2+1:len(s)]
if ("".join(s1) == "".join(s2)) :
  print("Yes")
else :    
  print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
S1 = S[:(N-1)//2]
S2 = S[(N+1)//2:]

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0
inf = float("inf")

S = s()
n = len(S)
a = S[:n//2]
b = S[n//2+1:]
print("Yes" if a == a[::-1] == b == b[::-1] else "No")

Submission status: Accepted

Solution code:
a = input()
l = len(a)
m = a[:l//2]
n = a[l//2 + 1 :]
if a[::-1] == a and m == m[::-1] and n == n[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
a = S[:N // 2]
b = S[N // 2 + 1:]
print('Yes' if a == a[::-1] == b == b[::-1] else 'No')

Submission status: Accepted

Solution code:
S = input()
n = len(S)

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

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
if s != s[::-1]:
  print('No')
else:
  s_1 = s[0:(n-1)//2]
  s_2 = s[(n+1)//2:n]
  if s_1 == s_1[::-1] and s_2 == s_2[::-1]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
a = int((n-1)/2)
aa = s[:a]
b = int((n+3)/2-1)
bb = s[b:]

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

Submission status: Accepted

Solution code:
S = str(input())
if len(S) % 4 == 1:
    m = len(S) // 4
    for i in range(m):
        if (S[i] != S[2 * m - i - 1] or
            S[2 * m - i - 1] != S[2 * m + 1 + i] or
            S[2 * m + 1 + i] != S[4 * m - i]):
            print('No')
            exit()    
else:
    m = len(S) // 4 + 1
    for i in range(m - 1):
        if (S[i] != S[2 * m - i - 2] or
            S[2 * m - i - 2] != S[2 * m + i] or
            S[2 * m + i] != S[4 * m - i - 2]):
            print('No')
            exit()
    if S[m - 1] != S[3 * m - 1]:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
ans = "No"
cnt = 0
if s[::1] == s[::-1]:
    cnt += 1
if s[:int((n-1)/2):1] == s[int((n-1)/2)-1::-1]:
    cnt += 1
if s[int((n+1)/2)::1] ==  s[:int((n-1)/2):-1]:
    cnt += 1
if cnt == 3:
    ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

Submission status: Accepted

Solution code:
import sys
s = input()
pre = []
back = []
for i in range((len(s)-1)//2):
    pre.append(s[i])
s1 = ''.join(pre)

for i in range((len(s)+3)//2-1,len(s)):
    back.append(s[i])
s2 = ''.join(back)

if s != s[::-1]:
    print('No')
    sys.exit()
elif s1 != s1[::-1]:
    print('No')
    sys.exit()
elif s2 != s2[::-1]:
    print('No')
    sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
S = input()

flag = 0
N = len(S)

s1 = int((N-1)/2)
s2 = int((N+3)/2)


if S[0:s1] == S[s1+1:]:
  flag = 1
else:
  flag = 0    

if S[s2-1:] == S[:s2-2]:
  flag = 1
else:
  flag = 0
  
if flag == 1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
a = int((n-1)/2)
aa = s[:a]
b = int((n+3)/2-1)
bb = s[b:]

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

Submission status: Accepted

Solution code:
import sys
#input = sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

#import numpy as np

def main():
	s=input()
	n=len(s)
	ans="Yes"

	if s!=s[::-1] or s[:(n-1)//2]!=s[:(n-1)//2][::-1] or s[(n+3)//2-1:]!=s[(n+3)//2-1:][::-1]:
		ans="No"

	print(ans)

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
s = input()

n = len(s)
i = int((n-1)/2)
t = s[:i]
ii = int((n+3)/2-1)
u = s[ii:]

if s == s[::-1] and t == t[::-1] and u == u[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
c = int((len(s) - 1)/2)
ans = (list(s) == list(reversed(s)) and list(s[:c]) == list(reversed(s[:c])) and list(s[(c+1):]) == list(reversed(s[(c+1):])))
print(["No", "Yes"][ans])

Submission status: Accepted

Solution code:
S = str(input())

flag = True
N = len(S)

for i in range(N // 2):
    if S[i] != S[-1 * i-1]:
        #print(i,-1*i,S[i],S[-1 * i-1])
        flag = False

for i in range((N-1)//2-1):
    if S[i] != S[(N-1)//2-1-i]:
        #print(i, (N-1)//2-1-i, S[i], S[(N-1)//2-1-i])
        flag = False

for i in range((N+3)//2,N-1):
    if S[i] != S[-1 * i-1]:
        #print(i, (N-1)//2-1-i, S[i], S[(N-1)//2-1-i])
        flag = False

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
S = input()
ln = len(S)
if S == S[::-1]:
    if S[:(ln-1)//2] == S[:(ln-1)//2][::-1]:
        if S[(ln+3)//2 - 1:] == S[(ln+3)//2 - 1:][::-1]:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
def main(S):
    N = len(S)
    if S == S[::-1] and S[:(N - 1) // 2] == S[:(N - 1) // 2][::-1] and S[(N + 1) // 2:] == S[(N + 1) // 2:][::-1]:
        return True
    else:
        return False
S = list(input())
if main(S) == True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
a = s[::-1]
n = len(s)
ans = "Yes"
if s != a: ans = "No"
elif s[:(n-1)//2] != s[(n+3)//2-1:]: ans = "No"
print(ans)

Submission status: Accepted

Solution code:
S = input().strip()
N = len(S)
flag = 0
if S==S[::-1]:
    x = S[:N//2]
    if x==x[::-1]:
        flag = 1
if flag==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def main():
    S = str(input())
    n = len(S)
    frontN = (n - 1) // 2
    backN = (n + 3) // 2
    
    checkFN = frontN // 2
    checkFNW = S[0:frontN]
    for i in range(checkFN):
        temp = (i + 1) * -1
        if checkFNW[i] == checkFNW[temp]:
            continue
        else:
            print('No')
            return
    
    checkBN = n - backN
    checkBNW = S[backN - 1:n]
    for i in range(checkBN // 2):
        temp = (i + 1) * -1
        if checkBNW[i] == checkBNW[temp]:
            continue
        else:
            print('No')
            return

    for i in range(n // 2):
        temp = (i + 1) * -1
        if S[i] == S[temp]:
            continue
        else:
            print('No')
            return
    
    print('Yes')
main()

Submission status: Accepted

Solution code:
s=input()

sr=s[::-1]

slen=len(s)

s1=(slen-1)//2 #3
s2=(slen+1)//2 #4

s1s=s[0:s1]
s1sr=s1s[::-1]
s2s=s[s2::]
s2sr=s2s[::-1]

if s==sr:
    if s1s==s1sr and s2s==s2sr:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
#s="akasaka"

def kaibun(x):
    ans=1
    for i in range(len(x)//2):
        if x[i]!=x[-i-1]:
            ans=0
            break
    return ans
n=len(s)
a1=kaibun(s)
a2=kaibun(s[0:(n-1)//2])
a3=kaibun(s[-1+(n+3)//2:n])

if a1==1 and a2==1 and a3==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
k = int((len(s) -1)/2) 
l = int((len(s) + 3)/2) - 1
n = list(s)
if n[0:k] == n[l:]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def palin(x):
    #print(x)
    if x == x[::-1]: return True
    return False
 
a = input()
n = len(a)
if palin(a) and palin(a[:int((n-1)/2)]) and palin(a[int((n+3)/2)-1:]):
    print("Yes")
else: print("No")

Submission status: Accepted

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

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

if S == S[::-1]:
    if one == one[::-1]:
        if two == two[::-1]:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

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

one = S[:int((N-1) / 2)]
two = S[int((N+3) / 2)-1:]

if S == S[::-1]:
    if one == one[::-1]:
        if two == two[::-1]:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def I(): return int(sys.stdin.readline().rstrip())
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)
if s != s[::-1]:
    print("No")
else:
    ss = s[:(N-1)//2]
    if ss != ss[::-1]:
        print("No")
    else:
        sss = s[((N+3)//2)-1:]
        if sss != sss[::-1]:
            print("No")
        else:
            print("Yes")

Submission status: Accepted

Solution code:
S: str = input()
n = len(S)

if not S == S[::-1]:
    print('No')
    exit()

end = (n-1)//2
SS = S[:end]

if not SS == SS[::-1]:
    print('No')
    exit()

start = (n+3)//2 - 1
SSS = S[start:n]

if not SSS == SSS[::-1]:
    print('No')
    exit()

print('Yes')

Submission status: Accepted

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

def check(S1):
    if S1 != S1[::-1]:
        return False
    else:
        return True

POS = int((N-1)/2)
S1 = S[0:POS]
POS = int((N+3)/2)
S2 = S[POS-1:N]

if check(S) == False or check(S1) == False or check(S2) == False:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S=input()
N=len(S)
A=S[:(N-1)//2]
B=S[(N+3)//2-1:]
if S!=S[::-1] or A!=A[::-1] or B!=B[::-1]:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

def kaibun(x):
    N = len(x)
    flag = True
    for i in range(N // 2):
        if x[i] != x[-i - 1]:
            flag = False
    return flag

tmp1 = kaibun(S)
tmp2 = kaibun(S[:(len(S) - 1) // 2])
tmp3 = kaibun(S[(len(S) + 3) // 2 - 1:])


if tmp1 and tmp2 and tmp3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

for i in range(1,n1+1):
    if s[i-1]!=s[-i]:
        print('No')
        exit()
for i in range(1,n1//2+1):
    if s1[i-1]!=s1[-i]:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
front = (n-1) // 2
rear = (n+2) // 2
sf = s[:front]
sr = s[rear:]
srev = s[::-1]
sfrev = sf[::-1]
srrev = sr[::-1]
if sfrev == sf and srrev == sr and srev == s:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

if S[:len(S)//2] != S[:len(S)//2][::-1]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
s = input()

n = len(s)
a, b = s[:(n - 1) // 2], s[(n + 1) // 2:]

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

Submission status: Accepted

Solution code:
s=input()
count=0
n=int(len(s))
t1=s[:int((n-1)/2)]
t2=s[int((n+3)/2-1):]
result='No'
if s==s[::-1]:
    if t1==t1[::-1]:
        if t2==t2[::-1]:
            result='Yes'
print(result)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
x=n//2
a=s[0:x]
b=s[x+1:]
if a==b:print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
s = input()
n = len(s)
t = s[:(n - 1) // 2]
u = s[(n + 1) // 2:]
print("YNeos"[any([s != s[::-1], t != t[::-1], u != u[::-1]])::2])

Submission status: Accepted

Solution code:
s=input()
n=len(s)
x=n//2
a=s[0:x]
b=s[x+1:]
if a==b:print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
s = list(input())
b = s[:(len(s) - 1) // 2]
e = s[:(len(s) - 1) // 2:-1]
e_b = s[(len(s) + 3) // 2 - 1:]
e_e = s[:(len(s) + 3) // 2 - 2:-1]
print("Yes") if b == e and e_b == e_e else print("No")

Submission status: Accepted

Solution code:
S = input()

ans = "No"
if S == S[::-1]:
    if S[:(len(S) - 1) // 2] == S[:(len(S) - 1) // 2][::-1]:
        if S[(len(S) + 3) // 2 - 1:] == S[(len(S) + 3) // 2 - 1:][::-1]:
            ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
s = list(input())

if s == s[::-1]:
    n = len(s)
    kai_1 = s[:(n-1)//2]
    kai_2 = s[(n + 3) // 2 - 1:]
    if (kai_1 == kai_1[::-1]) and (kai_2 == kai_2[::-1]):
        print("Yes")
        exit(0)

print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

n = len(s)
ans = 'No'

if s == s[::-1]:
  s_2 = s[:int((n - 1) / 2)]
  if s_2 == s_2[::-1]:
    s_3 = s[int((n + 3) / 2 - 1):]
    if s_3 == s_3[::-1]:
      ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
def is_kaibun(st):
  f = True
  for x,y in zip(st, st[::-1]):
    if x != y:
      f = False
      break
  return f
 
S = input()
ans = False
if is_kaibun(S):
  if is_kaibun(S[:(len(S)-1)//2]):
    ans = is_kaibun(S[(len(S)+3)//2-1:])
if ans:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()
N = len(S)
A = []
for s in range(N):
    A.append(S[s])
B = []
C = []
B = A[:(N-1)//2]
C = A[(N+3)//2-1:N]
if B == C:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit
S = input()
N = len(S)
back_S = S[::-1]
if S != back_S:
    print("No")
    exit(0)

slice1_S = S[0:int((N-1)/2)]
back_s1S = slice1_S[::-1]
if slice1_S != back_s1S:
    print("No")
    exit(0)

slice2_S = S[int((N+3)/2)-1:N]
back_s2S = slice2_S[::-1]
if slice2_S != back_s2S:
    print("No")
    exit(0)

print("Yes")

Submission status: Accepted

Solution code:
import sys
S = input()
N = len(S)
con = int((N-1)/2)  # 真ん中(0～のindex)

# 3文字の時
if N == 3:
    if S[0] == S[2]:
        print('Yes')
    else:
        print('No')
    sys.exit()

# conが偶数の時は前にある個数(con2,con3)も偶数
if con % 2 == 0:
    con20 = int(con/2-1)
    con21 = con20+1
    con30 = int(N-(N+3)/4)
    con31 = con30+1
    while con21 < con:
        if S[con20] != S[con21] or S[con20] != S[con31] or S[con21] != S[con30]:
            print('No')
            sys.exit()
        con20 = con20-1
        con21 = con21+1
        con30 = con30-1
        con31 = con31+1

# conが奇数の時は前にある個数(con2,con3)も奇数
else:
    con25 = int((con-1)/2)
    con35 = N-con25-1
    if S[con25] != S[con35]:
        print('No')
        sys.exit()
    con20 = con25-1
    con21 = con25+1
    con30 = con35-1
    con31 = con35+1
    while con21 < con:
        if S[con20] != S[con21] or S[con20] != S[con31] or S[con21] != S[con30]:
            print('No')
            sys.exit()
        con20 = con20-1
        con21 = con21+1
        con30 = con30-1
        con31 = con31+1

print('Yes')

Submission status: Accepted

Solution code:
s=str(input())
n=len(s)

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

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

new_n2=int((n+3)/2)
new_s2=s[new_n2-1:]
for i in range(0,len(new_s1)):
 if new_s1[i]!=new_s1[-i-1]:
    print("No")
    exit()
else:
  pass
for i in range(0,len(new_s2)):
 if new_s2[i]!=new_s2[-i-1]:
    print("No")
    exit()
else:
  print("Yes")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
res = False
P = []
L = []
K = []
for s in range(N):
    P.append(S[s])
L = P[:(N-1)//2]
K = P[(N+3)//2-1:N]
if L == K:
    res = True
if res:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
s = str(input())

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

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

for i in range(len(s1)//2):
    if s1[i] != s1[-1-i] or s2[i] != s2[-1-i]:
        print("No")
        sys.exit()

print("Yes")

Submission status: Accepted

Solution code:
#

import sys
input=sys.stdin.readline

def main():
    S=input().strip("\n")
    N=len(S)
    s1=S[:(N-1)//2]
    s2=S[(N+3)//2-1:N]
    if S==S[::-1] and s1==s1[::-1] and s2==s2[::-1]:
        print("Yes")
    else:
        print("No")
            
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
s=list(input())
length=len(s)
idx_half=int((length-1)/2)

if s==s[::-1] and s[:int((length-1)/2)]==s[int((length-1)/2)-1::-1] and s[int((length+3)/2-1):]==s[:int((length+3)/2-2):-1]:    
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
S = input()
n = len(S)
x = int((n-1)/2)
y = int(x/2)
for i in range(x) :
    if S[i] != S[n-i-1] :
        print("No")
        sys.exit()
for j in range(y) :
    if S[j] != S[x-j-1] :
        print("No")
        sys.exit()
    if S[x+j+1] != S[n-j-1] :
        print("No")
        sys.exit()   
print("Yes")

Submission status: Accepted

Solution code:
s = input()

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

if s1 == s1[::-1] and s2 == s2[::-1] and s3 == s3[::-1] :
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import itertools
import functools
import math
from collections import Counter
from itertools import combinations


S=input()

N=int(len(S))

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


chk = 0

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

for i in range((N-1)//2):
    if A1[i] != A1[((N-1)//2) - (N%2) - i]:
        chk = 1
        break
    if A2[i] != A2[((N-1)//2) - (N%2) - i]:
        chk = 1
        break

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

Submission status: Accepted

Solution code:
S=list(input())
top_S = S[:len(S)//2]
S.reverse()
down_S = S[:len(S)//2]
if(top_S==down_S):
    top_top_S=top_S[:len(top_S)//2]
    top_S.reverse()
    top_down_S =top_S[:len(top_S)//2]
    down_top_S = down_S[:len(down_S)//2]
    down_S.reverse()
    down_down_S = down_S[:len(down_S)//2]
    if (top_top_S == top_down_S and down_top_S == down_down_S):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
def check(line):
    n = len(line)
    flag = True
    for i in range(n // 2):
        if line[i] != line[n - i - 1]:
            flag = False

    return flag

s = list(input())
n = len(s)
sf = s[:n//2]
sb = s[n//2 + 1:]
if sf != sb:
    print("No")
else:
    if check(sf):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
s = list(input())
a = s[:len(s)//2]
b = s[len(s)//2+1:]
res = 0
if s[::-1] == s: res+=1
if a[::-1] == a: res+=1
if b[::-1] == b: res+=1
print("Yes" if res == 3 else "No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
N1s = (N-1)//2
N2s = (N+3)//2-1

if S[:N1s] == S[N2s:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
a=all([p==q for p,q in zip(s,reversed(s))])
b=all([p==q for p,q in zip(s[:(n-1)//2],reversed(s[:(n-1)//2]))])
c=all([p==q for p,q in zip(s[(n+3)//2-1:],reversed(s[(n+3)//2-1:]))])

if a and b and c:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()
d = int((len(S) - 1) / 2)
e = int((len(S) + 3) / 2)
if S == S[::-1] and S[0:d] == S[d - 1:: -1] and S[e - 1:] == S[int(len(S)): e - 2: -1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
d = int((len(s)-1) / 2)
e = int((len(s)+3) / 2)
if s == s[::-1] and s[0:d] == s[d-1::-1] and s[e-1:] == s[int(len(s)):e-2:-1]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
X=input()
n=len(X)
if n%2==0:
    print("No")
    sys.exit()
ans="No"
def check(s): 
    return s == s[::-1] 
ans="No"
if check(X):
    if check(X[0:int((n-1)/2)]):
        if check(X[int(((n+3)/2)-1):]):
            ans="Yes"
print(ans)

Submission status: Accepted

Solution code:
s = input()

s_1=s[:((len(s)-1)//2)]
s_2=s[((len(s)+3)//2)-1:]
#print(s_1)
#print(s_2)

flag = True

for a in range(len(s)//2):
    if s[a] != s[-(a+1)]:
        flag =False

for a in range(len(s_1)//2):
    if s_1[a] != s_1[-(a+1)]:
        flag =False

for a in range(len(s_2)//2):
    if s_2[a] != s_2[-(a+1)]:
        flag =False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
h=n//2
f=s[:h]
e=s[:-h-1]

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

Submission status: Accepted

Solution code:
S = list(input())

N = int(len(S))
mi = int((N-1)/2)
mo = int((N+3)/2-1)

if S[:mi] == S[mo:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

first_sep = int((len(s) - 1) / 2)
second_sep = int((len(s) + 3) / 2) - 1

first = s[0:first_sep]
second = s[second_sep:]

s_rev = s[::-1]
first_rev = first[::-1]
second_rev = second[::-1]

if s == s_rev and first == first_rev and second == second_rev:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = str(input())
mid = (len(s) + 1)//2

def palin(st):
    return st == st[::-1]

print('Yes' if palin(s[0:mid-1]) and palin(s[mid:]) and palin(s) else 'No')

Submission status: Accepted

Solution code:
S = input()

n = len(S)

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

if all(map(is_palindrome, [S, S[:n//2], S[n//2+1:]])):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def palin(x):
    #print(x)
    if x == x[::-1]: return True
    return False

a = input()
n = len(a)
if palin(a) and palin(a[:int((n-1)/2)]) and palin(a[int((n+3)/2)-1:]):
    print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
 
sys.setrecursionlimit(10 ** 7)
 
from collections import defaultdict
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())
# list(map(int, input().split()))

S = input()
N = len(S)

l = S[:N//2]
r = S[N//2 + 1:]

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

Submission status: Accepted

Solution code:
s = input()
def f(t):
  n = len(t)
  ok = True
  for i in range(n // 2):
    if t[i] != t[n - 1 - i]:
      ok = False
      break
  return ok
N = len(s)
if f(s) and f(s[:(N - 1) // 2]) and f(s[(N + 3) // 2 - 1:]):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
string = input()

def palindrome(inp):
  if inp == inp[::-1]: return True
  else: return False

if palindrome(string) and palindrome(string[:int((len(string) -1)/2)]) and palindrome(string[int((len(string) +1)/2):]): print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
s = input()
s_r = s[::-1]
ans = "No"
if s == s_r:
    ss = s[:int((len(s) - 1) / 2)]
    ss_r = ss[::-1]
    if ss == ss_r:
        sss = s[int((len(s) + 3) / 2) - 1:]
        sss_r = sss[::-1]
        if sss == sss_r:
            ans = "Yes"
print(ans)

Submission status: Accepted

Solution code:
def solve(s):
  if s != s[::-1]: return True
  ss = s[:len(s)//2]
  if ss != ss[::-1]: return True

S = input()
ans = "Yes" if not solve(S) else "No"
print(ans)

Submission status: Accepted

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

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

cnt = 0
if S == S[::-1]:
  cnt += 1
if S1 == S1[::-1]:
  cnt += 1
if S2 == S2[::-1]:
  cnt += 1
  
if cnt == 3:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def solve(s):
  if s != s[::-1]:   return False
  ss = s[:len(s)//2]
  if ss != ss[::-1]: return False
  else: return True
  
s = input()
ans = "Yes" if solve(s) else "No"
print(ans)

Submission status: Accepted

Solution code:
S=input()
s=S[::-1]
s2=list(S)
N1=int((len(S)-1)/2)
N2=int((len(S)+3)/2)-1
a1=[]
a2=[]
for i in range(0,N1):
    a1.append(s2[i])
T=''.join(a1)
t=T[::-1]
for i in range(N2,len(S)):
    a2.append(s2[i])
U=''.join(a2)
u=U[::-1]
if S==s and U==u and T==t:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if n%2==0 or s!=s[-1::-1]:
    print("No")
else:
    if s[:(n-1)//2]==s[(n-1)//2-1::-1] and s[(n+3)//2-1:]==s[-1:(n+3)//2-2:-1]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
s = input()
l = len(s)//2
s_ = s[::-1]
s1 = s[:l]
s1_ = s1[::-1]
s2 = s[l+1:]
s2_ = s2[::-1]
 
if s == s_ and s1 == s1_ and s2 == s2_:
    print("Yes")
else:
    print("No")