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: Wrong Answer

Solution code:
s = input()
no = 0
n = len(s)
for i in range(n):
    if s[i] != s[n-1-i]:
        no = 1
# print(no)
for i in range((n-1)//2):
    if s[i] != s[(n-1)//2-1-i]:
        no = 1
# print(no)
j = 0
for i in range((n+3)//2+1, n):
    if s[i] != s[n-1-j]:
        no = 1
    j += 1
if no == 1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    N = len(S)
    P = S[:(N-1)//2]
    Q = S[(N+3)//2 - 1:]
    if (P[:len(P)//2] == P[len(P)//2 + 1:]) and (Q[:len(Q)//2] == Q[len(Q)//2 + 1:]):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s=list(input())
n=len(s)
flag1=True
flag2=True

b=s[:(n-1)//2]
c=s[(n+1)//2:]

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

Submission status: Wrong Answer

Solution code:
#X=list(map(int,input().split()))
def judge(s):
  ans=1
  for i in range(len(s)):
    ans*=(s[i]==s[len(s)-1-i])
  return ans;
S=input();N=len(S)
print("Yes"if judge(S[:(N-1)//2])*judge(S[(N+2)//2:])else "No")

Submission status: Wrong Answer

Solution code:
def isparin(t):
    #print(t)
    M=len(t)
    for i in range(M):
        if t[i]!=t[M-1-i]:
            return False
    return True

S=input()
N=len(S)

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

Submission status: Wrong Answer

Solution code:
import sys

s = sys.stdin.readline().strip()
l = len(s)

half = l // 2

left = s[:half]

if half % 2:
    right = s[half+1:]
else:
    right = s[half:]


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


if is_pal(s) and is_pal(left) and is_pal(right):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def is_ok(S):
    N = len(S)
    for i in range(N):
        if S[i]!=S[-i-1]:
            return False
    return True
def main():
    S=ST()
    N=len(S)
    a = is_ok(S[:(N-1)//2])
    b = is_ok(S[(N+3)//2-1:])
    if(a and b):
        print("Yes")
    else:
        print("False")
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
cnt = 0
if s == s[::-1]:
    cnt += 1

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

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

Submission status: Wrong Answer

Solution code:
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    S = sr()
    N = len(S)
    a = S[:(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')
resolve()

Submission status: Wrong Answer

Solution code:
def palindrome(s):
    return s == s[::-1]

def judge(s):
    return palindrome(s) and palindrome(s[0:len(s)-1//2]) and palindrome(s[len(s)-1//2:])

S = input()
print('Yes' if judge(S) else 'No')

Submission status: Wrong Answer

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

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

if x1 == x1[::-1] and x2 == x2[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)

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

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

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time, copy,bisect
from operator import itemgetter
#from heapq import heappush, heappop
#import numpy as np
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson
#from scipy.sparse import csr_matrix
#from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
nf = lambda: float(ns())
na = lambda: list(map(int, stdin.readline().split()))
nb = lambda: list(map(float, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

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

Submission status: Accepted

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

for i in range(m):
  #print(s[i],s[-i-1])
  if s[i]!=s[-i-1]:
    print('No')
    exit()
if m%2==1: l=(m-1)//2
else: l=m//2
for i in range(l):
  #print(t[i],t[-i-1])
  if t[i]!=t[-i-1]:
    print('No')
    exit()
print('Yes')

Submission status: Accepted

Solution code:
S = input()

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
SS=S[0:(N-1)//2]
SSS=S[(N+1)//2:N+1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def sep():
    return map(int,input().strip().split(" "))
def lis():
    return list(sep())

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
flag = False
 
 
def palind(S):
    size = len(S)
    for i in range(size//2):
        if S[i] != S[-1-i]:
            return False
    return True
 
 
 
if palind(s):
    m = (n-1)//2
    sb = s[:m]
    if palind(sb):
        sa = s[m+1:]
        flag = palind(sa)
 
print("Yes" if flag else "No")

Submission status: Accepted

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


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



if palind(s):
    m = (n-1)//2
    sb = s[:m]
    if palind(sb):
        sa = s[m+1:]
        flag = palind(sa)

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

Submission status: Accepted

Solution code:
S=input()
size=len(S)
def palin(S,size):
    for i  in range (size//2):
        if S[i]!=S[-1-i]:
            return False
    return True
if palin(S,size) == True:
    L=S[:size//2]
    R=S[size//2+2:]
    if palin(L,size//2) & palin(L,size//2):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
string=input()
palindrome=False
palin1=False

def palin(string):
    palindrome=False
    if string==string[::-1]:
        palindrome=True
    return palindrome

palindrome=palin(string)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if 4 < len(s) < 6:
  print('No')
  exit()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=int((len(s)-1)/2)
c=0
for i in range(n):
  if s[i] == s[i+n+1]:
    c+=1
if c==n:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()


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


s_pali = is_palinedrome(s)
sub_pali_left = is_palinedrome(s[:len(s)//2])
sub_pali_right = is_palinedrome(s[len(s)//2+1:])

if s_pali and sub_pali_left and sub_pali_right:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
b = 0
if len(s)%2==1:
    for a in range(int((len(s)-1)/2)):
        if s[a]!=s[len(s)-a-1] and b==0:
            b = 1
else:
    b = 1
if b == 0:
    for c in range(int((len(s)-1)/4+1)):
        if s[c]==s[int((len(s)-1)/2-c-1)]==s[int((len(s)+1)/2+c)]==s[len(s)-c-1] and b==0:
            b = 0
        else:
            b = 1
if b == 0:
    print("Yes")
elif b == 1:
    print("No")

Submission status: Accepted

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

def judge_palindrome(s):
    if s == s[::-1]:
        return True
    else:
        return False

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

Submission status: Accepted

Solution code:
s = input()
a = int((len(s)-1)/2)
b = int((len(s)+3)/2)
r = ''.join(reversed(s[b-1:]))
if s[:a]== s[:a:-1] and s[b-1:]== r:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 159 B
S = input()
N = len(S)
Sf = S[0:(N-1)//2]
NSf = len(Sf)
Sb = S[(N+3)//2 -1:N+1]
NSb = len(Sb)
ans = 0

for i in range(N//2):
    if S[i:i+1] != S[N-1-i:N-i]:
        ans = 1

for i in range(NSf//2):
    if Sf[i:i+1] != Sf[NSf-1-i:NSf-i]:
        ans = 1
        
for i in range(NSb//2):
    if Sb[i:i+1] != Sb[NSb-1-i:NSb-i]:
        ans = 1
        
print('Yes') if ans == 0 else print('No')

Submission status: Accepted

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

S2 = S1[::-1]

a = S1 == S2

S3 = S1[:int((N - 1) / 2)]
S4 = S3[::-1]

b = S3 == S4

S5 = S1[int((N + 3) / 2) - 1:]
S6 = S5[::-1]

c = S5 == S6

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

else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
l = len(s)
okey = 1
ll = l//2

for i in range(0,l//2):
    if s[i] != s[l-i-1]:
        okey = 0
        break

if okey == 1: 
    for i in range(0,ll//2):
        if s[i] != s[ll-i-1]:
            okey = 0
            break

if okey == 1:
    for i in range(ll+1, ll+ll//2):
        if s[i] != s[l-i-1]:
            okey = 0
            break

if okey == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = str(input())
N = len(S)
sList = [str(s) for s in S]
isPalindrome = 1
str1 = ''
str2 = ''
str3 = ''
str4 = ''

for i in range(N):
  if (sList[i] != sList[N - 1 - i]):
    isPalindrome = 0
if isPalindrome == 1:
  for i in range(int((N - 1) / 2)):
    str1 += sList[i]
    str2 += sList[int((N - 1) / 2 - 1 - i)]
    str3 += sList[int((N + 3) / 2 - 1 + i)]
    str4 += sList[N - 1 - i]
    
    if str1 != str2:
      isPalindrome = 0
    if str3 != str4:
      isPalindrome = 0
if isPalindrome == 0:
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    S = input()

    N = len(S)
    for i in range(N):
        if S[i] != S[N-i-1]:
            print("No")
            return

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

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

    print("Yes")


main()

Submission status: Accepted

Solution code:
S = input()
flag = 0
for i in range(0,len(S)//2):
    if S[i] == S[-1-i]:
        continue
    else:
        flag = 1
        print("No")
        break
if flag == 0:
    S = S[:((len(S)-1)//2)]
    for i in range(0,len(S)//2):
        if S[i] == S[-1-i]:
            continue
        else:
            flag = 1
            print("No")
            break
if flag == 0:
    print("Yes")

Submission status: Accepted

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

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

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:
S=input()
N=len(S)
s=''.join(list(reversed(S)))

T=S[0:int((N-1)/2)]
NT=len(T)
t=''.join(list(reversed(T)))

U=S[int((N+1)/2):N]
NU=len(U)
u=''.join(list(reversed(U)))

if S[0:int((N-1)/2)] == s[0:int((N-1)/2)] and T == t and U == u:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()
N=len(S)
if S==S[::-1] and S[0:(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()

#print ((len(S)-1)//2)
#print ((len(S)+3)//2)
#print (S[0:(len(S)-1)//2])
#print (S[((len(S)+3)//2)-1:len(S)])
#print (S[::-1])

Skai1 = S[0:(len(S)-1)//2]
Skai1 = Skai1[::-1]
Skai2 = S[((len(S)+3)//2)-1:len(S)]
Skai2 = Skai2[::-1]

if S==S[::-1] and S[0:(len(S)-1)//2] ==Skai1 and S[((len(S)+3)//2)-1:len(S)] == Skai2: 
  print('Yes')
else:
  print("No")

Submission status: Accepted

Solution code:
N = str(input())
lenN = len(N)

fN =N[0:(lenN - 1)//2]
lN =N[(lenN + 3)//2-1:]
print(("No","Yes")[(0,1)[fN == fN[-1::-1]]*(0,1)[lN == lN[-1::-1]]*(0,1)[lN == fN]])

Submission status: Accepted

Solution code:
S=input()
rS=S[::-1]

le=len(S)
cent=int((le+1)/2)

S1=S[0:cent-1]
S2=S[cent:]
rS1=S1[::-1]
rS2=S2[::-1]

if S==rS and S1==rS1 and S2==rS2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s=input()
n=len(s)
def isk(S):
  l=len(S)
  f=1
  for i in range(l//2+1):
    if S[i]==S[l-i-1]:
      f*=1
    else:
      f=0
  if f:
    return True
  else:
    return False
  
if isk(s) and isk(s[:(n-1)//2]) and isk(s[(n+1)//2:]):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

a = int((n-1)/2)
b = int((n+3)/2)

for i in range(a):
  if s[i] != s[n-1-i]:
    print("No")
    exit()
    
for i in range(a):
  if s[i] != s[a-1-i]:
    print("No")
    exit()
    
for i in range(a):
  if s[b+i-1] != s[n-1-i]:
    print("No")
    exit()
    
print("Yes")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
def is_palindrome(s):
    return s == ''.join(list(reversed(s)))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
s = list(map(str, S))
N = len(s)
t = 0
for i in range(int((N-1)/2)):
    if s[i] != s[N-i-1]:
        t += 1
        break
for i in range(int((N-1)/4)):
    if s[i] != s[int((N-1)/2) - i - 1]:
        t += 1
        break

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

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
flag = 0
for i in range(n//2):
    if s[i] != s[n-i-1]:
        flag = 1
if flag == 0:
    s2 = s[:(n-1)//2]
    n2 = len(s2)
    for i in range(n2//2):
        if s2[i] != s2[n2-i-1]:
            flag = 1
#print(n, n2, s, s2)
if flag == 0:
    if flag == 0:
        s2 = s[(n+3)//2-1:]
        n2 = len(s2)
    for i in range(n2//2):
        if s2[i] != s2[n2-i-1]:
            flag = 1
#print(s2)
if flag == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
kaibunkai = input()
n = len(kaibunkai)
zenhan = kaibunkai[:(n-1)//2]
kouhan = kaibunkai[(n+3)//2-1:]


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

if kaibun_desuka(kaibunkai) and kaibun_desuka(zenhan) and kaibun_desuka(kouhan):
  print("Yes")

  
else:
  print("No")

Submission status: Accepted

Solution code:
import math
s = list(input())
n = len(s)
s1 = s[ : (n-1) // 2]
s2 = s[(n+3) // 2 - 1 : n]
flag = 1

for i in range(len(s) // 2):
    if s[i] != s[- i - 1]:
        flag = 0

for i in range(len(s1) // 2):
    if s1[i] != s1[- i - 1]:
        flag = 0

for i in range(len(s2) // 2):
    if s2[i] != s2[- i - 1]:
        flag = 0

print('Yes' if flag == 1  else 'No')

Submission status: Accepted

Solution code:
def main():
    S = input()
    N = len(S)
    S1 = S[0:(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')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def check(string):
    if string == string[::-1]:
        return True
    else:
        return False


S = input()
n = len(S)

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

if check(S) and check(S1) and check(S2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
def isPalindrome(s):
  n = len(s)
  flag=True
  slist=list(s)
  for i, c in enumerate(slist):
    if c!=slist[n-1-i]:
      flag=False
    if i > n-i:
      break
  return flag

Slist=list(S)

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

Submission status: Accepted

Solution code:
S=input()
S2=S[:(len(S)-1)//2]
S3=S[(len(S)+3)//2-1:]
if S==S[::-1] and S2==S2[::-1] and S3==S3[::-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:]

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

Submission status: Accepted

Solution code:
s = input()
num = len(s)
n1 = s[0:(num-1) // 2]
n2 = s[(len(s)+3) // 2-1:]

if s == s[::-1] and n1 == n1[::-1] and n2 == n2[::-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:]
if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

def check(a):
  n = len(a)
  if n % 2 == 0:
    for i in range(n//2):
      if a[i] != a[n-i-1]:
        return False
    return True
  else:
    for i in range((n-1)//2):
      if a[i] != a[n-i-1]:
        return False
    return True

res = "No"
if check(s):
  #print(s)
  if check(s[:(l-1)//2]):
    if check(s[(l+3)//2 - 1:]):
      res = "Yes"

print(res)

Submission status: Accepted

Solution code:
kai = input()
num = len(kai)

ans = 0

n1 = int((num-1) / 2)

for i in range(n1):
    if kai[i] != kai[-1*(i+1)]:
        ans += 1

l1 = kai[0:n1]

for i in range(len(l1)):
    if l1[i] != l1[-1*(i+1)]:
        ans += 1

l2 = kai[n1+1:]

for i in range(len(l2)):
    if l2[i] != l2[-1*(i+1)]:
        ans += 1

if ans == 0:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
a = s[0:n//2]
b = s[n//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:

def main():
    s = input()
    n = len(s)
    for i in range(n//2):
        if s[i] != s[n-1-i]:
            print("No")
            return
    s1 = s[:(n-1)//2]
    s2 = s[(n+3)//2-1:]
    n1 = len(s1)
    for i in range(n//4):
        if s1[i] != s[n1-1-i]:
            print("No")
            return
        if s2[i] != s[n1-1-i]:
            print("No")
            return
    print("Yes")

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

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

Submission status: Accepted

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

def palindrome(string):
  return 0 if string==string[::-1] else 1

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

#print(ls1)
#print(ls2)


if palindrome(S) == palindrome(ls1) == palindrome(ls2) == 0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = list(input())
k = (len(S) -1) // 2 
T = S[0:k]
#print(T[::-1])
print("Yes" if S == S[::-1] and T == T[::-1] else "No")

Submission status: Accepted

Solution code:
import sys
s=list(input())
r=list(reversed(s))
n=len(s)

for i in range(n):
    if s[i]!=r[i]:
        print('No')
        sys.exit()

s1=s[:]

del s1[(n-1)//2:]
r1=list(reversed(s1))

for i in range(len(s1)):
    if s1[i]!=r1[i]:
        print('No')
        sys.exit()

s2=s[:]

del s2[:(n+3)//2-1]
r2=list(reversed(s2))

for i in range(len(s2)):
    if s2[i]!=r2[i]:
        print('No')
        sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
s = S()
n = len(s)
ans = 'Yes'
if s != s[::-1]:
    ans = 'No'
x = math.floor(n/2)
y = math.ceil(n/2)
a = s[0:x]
b = s[y:]
if a != a[::-1] or b != b[::-1]:
    ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
# ABC159

def is_kaibun(string):

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


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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()
l = len(S) // 2
former = S[:l]
latter = S[l+1:]
print("Yes" if S == S[::-1] and former == former[::-1] and latter == latter[::-1] else "No")

Submission status: Accepted

Solution code:
S = input()
l = len(S) // 2
ll = l // 2
former = S[:l]
latter = S[l+1:]

for i in range(l):
  if S[i] != S[-i-1]:
    print("No")
    break
else:
  for i in range(ll):
    if former[i] != former[-i-1] or latter[i] != latter[-i-1]:
      print("No")
      break
  else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()
for i in [s, s[:len(s)//2], s[len(s)//2+1:]]:
  if i != i[::-1]:
    print("No")
    break
else:
  print("Yes")

Submission status: Accepted

Solution code:
s =input()
n = len(s)
if s[:(n-1)//2] ==s[:(n-1)//2][::-1] and s == s[::-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()
s1 = s[:(len(s)-1) // 2]
s2 = s[(len(s)+3) // 2 - 1:]
if s1 == s1[::-1] and s1 == s2[::-1] and s2 == s2[::-1]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

# 全体が回文かどうか
if s != s[::-1]:
    print('No')
# 1文字目から(N-1)/2文字目までからなる文字列が回文かどうか
elif s[:(n-1)//2] != s[:(n-1)//2][::-1]:
    print('No')
# Sの(N+3)/2文字目からN文字目までからなる文字列が回文かどうか
elif s[(n+3)//2-1:] != s[(n+3)//2-1:][::-1]:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
target = s[:(len(s)-1)//2]
target2 = s[(len(s)+3)//2-1:]
if target == target2:
    l, r = 0, len(s)-1
    flag = True
    while l <= r:
        if s[l] == s[r]:
            l += 1
            r -= 1
        else:
            print('No')
            exit(0)

    print("Yes")


else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

S_1=S[:N//2]
S_2=S[N//2+1:]

N_=len(S_1)
ans='Yes'
for n in range(N_):
    if S_1[n] != S_1[-(n+1)]:
        ans='No'
        break
    if S_2[n] != S_2[-(n+1)]:
        ans='No'
        break   
        
for n in range(N):
    if S[n] != S[-(n+1)]:
        ans='No'
        break

print(ans)

Submission status: Accepted

Solution code:
S = input()
N = len(S)
s = S[:(N-1)//2]
t = S[(N+3)//2-1:]

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

Submission status: Accepted

Solution code:
s=input()

def kaibun(w):
    for i in range(len(w)):
        if w[i]!=w[len(w)-1-i]:
            return False
    return True
n=len(s)
print("Yes") if all([kaibun(s) , kaibun(s[:(n-1)//2]) , kaibun(s[(n+3)//2-1:])]) else print("No")

Submission status: Accepted

Solution code:
S = list(input())
l = len(S)

def judge(arr):
  l = len(arr)
  if len(arr) % 2 != 0:
    l = len(arr)
  for i in range(int(l/2)):
    if arr[i] != arr[l-1-i]:
      print("No")
      exit()
      
judge(S)
center = int((l-1)/2)
judge(S[0:center])
judge(S[center+1:])
print("Yes")

Submission status: Accepted

Solution code:
S = input()
 
N = len(S)
ans = 'No'
 
# 文字列strの反転は、str[::-1]
if S == S[::-1] and S[:(N-1)//2] == S[:(N-1)//2][::-1] and S[(N+1)//2:] == S[(N+1)//2:][::-1]:
  ans = 'Yes'
  
print(ans)

Submission status: Accepted

Solution code:
S = input()

N = len(S)
ans = 'No'

# 文字列strの反転は、str[::-1]である
if S == S[::-1] and S[:(N-1)//2] == S[:(N-1)//2][::-1] and S[(N+1)//2:] == S[(N+1)//2:][::-1]:
  ans = 'Yes'
  
print(ans)

Submission status: Accepted

Solution code:
def isKaibun(ss):    
    return ss==ss[::-1]

s = input()
ans=True
n=len(s)

if not isKaibun(s):
    ans=False
if not isKaibun(s[:((n-1)//2)]):
    ans=False

if ans:
    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:]

def check(s):
  i=0
  j=len(s)-1
  while j>i:
    if s[j]!=s[i]:
      return False
    j-=1
    i+=1
  return True

if check(s) and check(s1) and check(s2):
  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:]

def check(s):
    #print(s)
    i = 0
    j = len(s) - 1
    while j > i:
        if s[j] != s[i]:
            return False
        j -= 1
        i += 1
    return True


if check(S) and check(S1) and check(S2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#B
S=input()

N=len(S)
con_2=S[:(N-1)//2]
con_3=S[((N+3)//2-1):]

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

Submission status: Accepted

Solution code:
S = input()

N = len(S)//2

print('Yes' if S[:N] == S[-N:] else 'No')

Submission status: Accepted

Solution code:
S=list(input())
N=len(S)
x=0
for i in range(int((N-1)/2)):
    if S[i]!=S[-(i+1)]:
        print("No")
        break
    elif i==int((N-1)/2)-1:
        x+=1
import math
if x==1:
    S_l=S[:int((N-1)/2)]
    for i in range(int(math.ceil(len(S_l)/2))):
        if S_l[i]!=S_l[-(i+1)]:
            print("No")
            break
        elif i==int(math.ceil(len(S_l)/2))-1:
            x+=1
if x==2:
    S_m=S[int((N+3)/2)-1:N]
    for i in range(int(math.ceil(len(S_m)/2))):
        if S_m[i]!=S_m[-(i+1)]:
            print("No")
            break
        elif i==int(math.ceil(len(S_m)/2))-1:
            print("Yes")