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:
class abc_159:
    
    def __init__(self):
        pass
    
    def A(self):
        NM=list(map(int,input().split()))
        print(int((NM[0]*(NM[0]-1))/2 + (NM[1]*(NM[1]-1))/2))
    
    def B(self):
        S=input()
        if S==S[::-1] and S[:int((len(S)-1)/2)]==S[:int((len(S)-1)/2):-1] and S[int((len(S)+3)/2)-1:len(S)]==S[int((len(S)+3)/2)-1:len(S)+1][::-1]:print("Yes")
        else:print("No")
        
            
    
    def C(self):
        pass
        
    def D(self):
        pass
    
    def E(self):
        pass
    
    def F(self):
        pass
    
    
if __name__=='__main__':
    obj=abc_159()
    obj.B()

Submission status: Accepted

Solution code:
s=input()

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

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

Submission status: Accepted

Solution code:
s = input()
t = s[::-1]

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
m1 = s[0:(n-1)//2]
m2 = s[((n+3)//2)-1:n+1]



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

Submission status: Accepted

Solution code:
s = input()

words = []
n = len(s)
words.append(s)
words.append(s[:(n-1)//2])
words.append(s[(n+1)//2:])
print("Yes" if all(T == T[::-1] for T in words) else "No")

Submission status: Accepted

Solution code:
S=input()
i=len(S)-1

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

Submission status: Accepted

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

words = []
words.append(S)
words.append(S[:(N-1)//2])
words.append(S[(N+3)//2 - 1:])

ans = all([word == word[::-1] for word in words])

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

Submission status: Accepted

Solution code:
S=input()
A=S[0:int((len(S)-1)/2)]
B=S[int((len(S)+3)/2):-1]
def kaibun(s):
    a,b="",""
    for i in range(len(s)):
        a = a+s[i]
        b = s[i]+b
    return a==b
print('Yes' if (kaibun(S) and kaibun(A) and kaibun(B)) else 'No')

Submission status: Accepted

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

if S == S[::-1]:
    if S[0:(N-1)//2] == S[0:(N-1)//2][::-1]:
        if S[((N+3)//2)-1:N] == S[((N+3)//2)-1:N][::-1]:
            print("Yes")
            sys.exit()


print("No")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
Ans='Yes'
        
if S[:int((N-1)/2)]!=S[:int((N-1)/2):-1]:
    Ans='No'
    
if int((N-1)/2)%2==0:
    if S[:int((N-1)/4)]!=S[int((N-3)/2):int((N-5)/4):-1]:
        Ans='No'
        
else:
    if N!=3 and S[:int((N-3)/4)]!=S[int((N-3)/2):int((N-3)/4):-1]:
        Ans='No'
    
print(Ans)

Submission status: Accepted

Solution code:
s=input()
ss = s[::-1]
ok=True
if s != ss:
    ok =False
n=len(s)
a = s[:(n-1)//2]
aa = a[::-1]
if a!=a:
    ok=False
b=s[(n+3)//2-1:]
bb=b[::-1]
if b!=bb:
    ok=False
print('Yes' if ok else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
S_2 = S[0 : int((N - 1) / 2)]
S_3 = S[int((N + 3) / 2)-1 :]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def is_palindrom(S, i, j):
    while i <= j and S[i] == S[j]:
        i += 1
        j -= 1
    return i > j


def solve():
    S = input().strip()
    N = len(S)
    if N == 1 or (is_palindrom(S, 0, N-1) and is_palindrom(S, 0, N//2-1)):
        return 'Yes'
    return 'No'


if __name__ == '__main__':
    print(solve())

Submission status: Accepted

Solution code:
def isKaibun(str):
    for i in range(len(str)):
        if str[i] != str[len(str)-i-1]:
            return False
    return True

s = input()

if not isKaibun(s):
    print("No")
elif not isKaibun(s[0:int((len(s) - 1) / 2)]):
    print("No")
elif not isKaibun(s[int((len(s) + 3) / 2)-1:len(s)]):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

s = input()
ans = []
ans.append(palindrome(s))
ans.append(palindrome(s[:len(s)//2]))
ans.append(palindrome(s[len(s)//2+1:]))
print("Yes") if all(ans) else print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

zenhan = []
kouhan = []
result1 = True
result2 = True
result3 = True


for i in range(len(S)//2):
    zenhan.append(S[i])

for i in range(len(S)//2+1,len(S)):
    kouhan.append(S[i])

for i in range(len(S)//2):
    if S[i] != S[len(S)-i-1]:
        result1 = False
        break

for i in range(len(zenhan)//2):
    if zenhan[i] != zenhan[len(zenhan)-i-1]:
        result2 = False
        break

for i in range(len(kouhan)//2):
    if kouhan[i] != kouhan[len(kouhan)-i-1]:
        result3 = False
        break
#print(zenhan)
#print(kouhan)
#print(result1,result2,result3)

if result1 and result2 and result3:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = list(input())

zenhan = []
kouhan = []
result1 = True
result2 = True
result3 = True


for i in range(len(S)//2):
    zenhan.append(S[i])

for i in range(len(S)//2+1,len(S)):
    kouhan.append(S[i])

for i in range(len(S)//2-1):
    if S[i] != S[len(S)-i-1]:
        result1 = False
        break

for i in range(len(zenhan)//2):
    if zenhan[i] != zenhan[len(zenhan)-i-1]:
        result2 = False
        break

for i in range(len(kouhan)//2):
    if kouhan[i] != kouhan[len(kouhan)-i-1]:
        result3 = False
        break
#print(zenhan)
#print(kouhan)
#print(result1,result2,result3)

if result1 and result2 and result3:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
l = len(s)
sl = s[:(l-1)//2]
sr = s[((l+3)//2 -1):]
#print(sl)
#print(len(sl)//2)
#print(sr)
#print(len(sr)//2)

def f(s):
    l = len(s)
    j = False
    for i in range(l//2 +1):
        if s[i] == s[l-1-i]:
            j = True
        else :
            j = False
            break

    return j

if f(s) and f(sl) and f(sr):
    print("Yes")
else :
    print("No")



#print(f(s))
#print(f(sl))
#print(f(sr))

Submission status: Accepted

Solution code:
S = input()
S2 = []
S3 = []
S4 = []
range1 = int((int(len(S))+1)/2)
range2 = int((int(len(S))-1)/2)
range3 = int((range2+1)/2)
range4 = int((int(len(S))+3)/2)
range5 = int((range4+1)/2)
isStrong = "Yes"
for i in S:
  S2.append(i)
  
for i in range(range2):
  S3.append(S2[i])
  
for i in range(range4-1,len(S)):
  S4.append(S2[i])
  
for i in range(range1):
  if S2[i]!=S2[-i-1]:
    isStrong = "No"

for i in range(range3):
  if S3[i]!=S3[-i-1]:
    isStrong = "No"

for i in range(range5-1):
  if S4[i]!=S4[-i-1]:
    isStrong = "No"
    
print(isStrong)

Submission status: Accepted

Solution code:
S=list(input())
N=len(S)
check=True
for i in range(N//2):
    if S[i]!=S[N-1-i]:
        check=False
        break
if check==False:
    print("No")
else:
    C=False
    for i in range((N//2)//2):
        if S[i]!=S[N//2-1-i]:#0123456
          C=True
          break
    if C==True:
        print("No")
    else:
        print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
a=int(n/2)
s1a=s[0:a]
s2a=s[n-a:n]
s2=s[::-1]
s1b=s1a[::-1]
s2b=s2a[::-1]
if s==s2 and s1a==s1b and s2a==s2b:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
A = list(input())
if A == A[::-1]:
    pass
else:
    print("No")
    exit()
B=len(A)
C = A[0:(B-1)//2]
if C == C[::-1]:
    pass
else:
    print("No")
    exit()
C = A[(B+3)//2-1:]
if C == C[::-1]:
    pass
else:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())

slist = list(S)
N = len(slist)
k = int((N-1)/2)

rs = slist[::-1]
front = slist[0:k]
rfront = front[::-1]

if front == rfront and rs == slist:
    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

s = input()

sinv = s[::-1]

n = len(sinv)

s1 = s[0:n//2]
s1inv = s1[::-1]


s2 = s[n//2+1:n]

s2inv = s2[::-1]

n1 = len(s2)

##print(s1,s1inv,s2,s2inv)

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

for i in range(n1):
    if s1[i]!=s1inv[i] or s2[i]!=s2inv[i]:
        print("No")
        sys.exit()

print("Yes")

Submission status: Accepted

Solution code:
S = input()
L = [S[i] for i in range(int((len(S)-1)/2))]
R = [S[-i-1] for i in range(int((len(S)-1)/2))]
def kaibun(A):
    is_flag = True
    for i in range(int((len(S)-1)/2)):
        if A[i] != A[-i-1]:
            is_flag = False
            break
        else:
            continue
    if is_flag == True:
        return True
    else:
        return False

is_flag = kaibun(S)
if is_flag == False:
    print("No")
else:
    if kaibun(L)==True and kaibun(R)==True:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys
s=input()
n=len(s)
s1=s
s1_rev=s1[::-1]

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

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

if s != s1_rev:
    print('No')
    sys.exit(0)
if s2 != s2_rev:
    print('No')
    sys.exit(0)
if s3 != s3_rev:
    print('No')
    sys.exit(0)

print('Yes')

Submission status: Accepted

Solution code:
S = list(str(input()))
N = len(S)
S1 = list()
S2 = list()

for i in range((N - 1) // 2):
  S1.append(S[i])
for j in range((N - 1) // 2):
  S2.append(S[j + (N + 1) // 2])

S_reverse = list(reversed(S))
S1_reverse = list(reversed(S1))
S2_reverse = list(reversed(S2))

if S == S_reverse and S1 == S1_reverse and S2 == S2_reverse:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
mozi = input()
N = len(mozi)
mozilist1 = list()
mozilist2 = list()
kai1 = (N - 1)//2
kai2 = (N + 3)//2

for i in range(kai1):
    mozilist1.append(mozi[i])
    

for j in range(kai2-1,N):
    mozilist2.append(mozi[j])
    
if mozilist1 == mozilist2:
    print("Yes")
    
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
h = len(S)//2
for i in range(h):
  if S[i] != S[-i-1]:
    print('No')
    exit()
for i in range(h//2):
  if S[i] != S[h-i-1]:
    print('No')
    exit()
for i in range(h//2):
  if S[h+i+1] != S[-i-1]:
    print('No')
    exit()
print('Yes')

Submission status: Accepted

Solution code:
s=input().rstrip()
n=len(s)
sf,sm,sl=s[:int((n-1)/2)],s[int((n-1)/2)],s[int((n+1)/2):]
 
if s==s[::-1] and sf==sf[::-1] and sl==sl[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = list(input())
s0 = list(reversed(s))
s1 = list(reversed(s[0:int((len(s)-1)/2)]))
s2 = list(reversed(s[int((len(s)+3)/2)-1:len(s)]))
if s[0:int((len(s)-1)/2)] == s1 and s[int((len(s)+3)/2)-1:len(s)] == s2 and s == s0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys

s = list(input())

if s==list(reversed(s)):
  print("",end="")
else:  
  print ("No")
  sys.exit()

l=len(s)
fs = (s[0:(l//2)]) 
if (fs)==(list(reversed(fs))):
  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:
List=list(input())
N=len(List)
if 0 not in [int(List[i]==List[(N-1-i)]) for i in range(N)]\
and List[0:(N-3)//2]==List[(N+1)//2:N-1]:
    print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
from collections import deque
s = list(input())
n = len(s)
d = deque(s)
d1 = deque(s[: (n-1)//2])
d2 = deque(s[(n+1)//2 :])
while len(d) > 1:
  if d.pop() != d.popleft():
    print('No')
    exit()
while len(d1) > 1:
  if d1.pop() != d1.popleft() or d2.pop() != d2.popleft():
    print('No')
    exit()
print('Yes')

Submission status: Accepted

Solution code:
import sys
s = input()
n = len(s)//2
l = n-1//2
m = n+3//2

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

a = s[:l]
b = s[m:]

if is_kaibun(s):
    if is_kaibun(a):
        if is_kaibun(b):
            print("Yes")
            sys.exit()
            
print("No")

Submission status: Accepted

Solution code:
s=input()

def check(s,start,stop):
    a=start
    b=stop
    while(a<=b):
        if(s[a]==s[b]):
            a+=1
            b-=1
        else:
            return False
    return True

if(check(s,0,len(s)-1) and check(s,0,((len(s)-1)//2)-1) and check(s,((len(s)+3)//2)-1,len(s)-1)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
n = len(S)//2
f = lambda s:all(i==j for i, j in zip(s, s[::-1]))
print("Yes" if f(S) and f(S[:n]) and f(S[n+1:]) else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

def judge(x):
    if ''.join(list(reversed(x)))==x:
        return True
    else:
        return False
    
def solve(x):
    t=len(x)-1//2
    t2=(len(x)+1)//2
    if judge(x) and judge(x[t2:]) and judge(x[0:t]):
        print('Yes')
    else:
        print('No')
        
solve(S)

Submission status: Accepted

Solution code:
s=input()
k=len(s)
flag=True
for i in range((k-1)//2):
    if s[i]!=s[k-1-i]:
        flag=False
        break
    else:
        continue
if flag==True:
    for j in range((k-1)//2//2+1):
        if s[j]!=s[(k-1)//2-j-1]:
            flag=False
            break
        else:
            continue
if flag==True:
    for a in range((k-1)//2//2+1):
        if s[a+(k+3)//2-1]!=s[k-a-1]:
            flag=False
            break
        else:
            continue
if flag==True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()
n=len(S)
a=0
b=0
for i in range(1,int(n/2)+1):
    if S[i-1]!=S[n-i]:
        a=1
        print("No")
        break;
p=[]
q=[]
if a==0:
    for i in range(1,int(n/2)+1):
        p.append(S[i-1])
        q.append(S[i+int(n/2)])
    #print(p,q)
    for i in range(1,int((len(p))/2)+1):
        #print(p[i-1],p[len(p)-i],q[i-1],q[len(p)-i])
        if p[i-1]!=p[len(p)-i] or q[i-1]!=q[len(p)-i]:
            b=1
            print("No")
            break;
if a==0 and b==0:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

def judge(x):
  if "".join(list(reversed(x))) == x:
    return True
  else:
    return False
  
def solve(x):
  if judge(x) and judge(x[0:int((len(x)-1)/2)]) and judge(x[int((len(x)+1)/2):]):
    print("Yes")
  else:
    print("No")
    
    
solve(S)

Submission status: Accepted

Solution code:
s = raw_input()
def f(s): return s == s[::-1]
print 'Yes ' if f(s) and f(s[:len(s)/2]) else 'No'

Submission status: Accepted

Solution code:
s = raw_input()
def f(s): return s == s[::-1]
print 'Yes ' if f(s) and f(s[:len(s)/2]) and f(s[1+len(s)/2:]) else 'No'

Submission status: Accepted

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

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)
   
S2 = S[:((N-1)//2)]
S3 = S[(N+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:
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    s1=input()
    s11=s1[::-1]
    s2=s1[:(len(s1)-1)//2]
    s22=s2[::-1]
    s3=s1[(len(s1)+3)//2-1:]
    s33=s3[::-1]
    if s1==s11 and s2==s22 and s3==s33:
        print('Yes')
    else:
        print('No')
resolve()

Submission status: Accepted

Solution code:
N=input()
t = int(len(N))
m = ((t+3)/2)
xs = N[0:int(((t-1)/2))]
ys = N[int(m-1):int(t)]
if ys==xs:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
a=[]
b=[]
c=[]
d=[]

for i in range((N-1)//2):
    if((N-1)//2%2==1):
        if((N-1)//4>i ):
            a.append(S[i])

        elif((N-1)//4!=i):
            b.append(S[i])
    else:
        if((N-1)//4>i ):
            a.append(S[i])

        elif((N-1)//4==i):
            b.append(S[i])

        elif((N-1)//4!=i):
            b.append(S[i])

if(a==b[::-1]):
    if(S==S[::-1]):

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

    for i in range((N+3)//2-1,N):
        if(((N+3)//2-1+N)//2>i ):
            c.append(S[i])
        elif(((N+3)//2-1+N)//2!=i):
            d.append(S[i])
    if(c==d):
        if(S==S[::-1]):

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

Submission status: Accepted

Solution code:
s = input()

a_pos = (len(s)-1) // 2
b_pos = (len(s)+3) // 2 - 1

s_first = s[:a_pos]
s_second = s[b_pos:]

if s == s[::-1]:
    if s_first == s_first[::-1]:
        if s_second == s_second[::-1]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
r1 = s[::-1]
n = len(s)
r2 = s[0:(n-1)//2]
r2r = r2[::-1]
r3 = s[(n+3)//2-1:]
r3r = r3[::-1]
if s == r1 and r2 == r2r and r3 == r3r:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def main():
    S = input()
    idx1 = int((len(S) - 1)/2)
    idx2 = int((len(S) + 3)/2) - 1
    flag1 = check(S)
    flag2 = check(S[:idx1])
    flag3 = check(S[idx2:])
    if flag1 and flag2 and flag3:
        print("Yes")
    else:
        print("No")


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

s = input()

all_s = is_palindrome(s)

n = len(s)
top_s = is_palindrome(s[: int((n - 1) / 2)])
bottom_s = is_palindrome(s[- int((n - 1) / 2):])

print("Yes" if all([all_s, top_s, bottom_s]) else "No")

Submission status: Accepted

Solution code:
n = input()

list1 = [str(x) for x in n]
list2 = []
list3 = []
matu = 0

for x in range(int((len(n)-1)//2)):
    list2.append(n[x])

for x in range(int(len(n)-(len(n)+3)//2 + 1)):
    matu = len(n) - x -1
    list3.append(n[matu])

list2_ke = ''.join(list2)
list3_ke = ''.join(list3)

if list1 == list(reversed(n)) and list2 == list(reversed(list2_ke)) and list3 == list(reversed(list3_ke)) :
    print("Yes")

else :
    print("No")

Submission status: Accepted

Solution code:
m=input()

n=len(m)

c=int((n-1)/2)
d=int((n+3)/2)
a=[]
b=[]

import sys

for i in range(0,c):

    a.append(m[i])


for k in range(d-1,n):

    b.append(m[k])

for l in range(int(len(a))):

    if a[l]==a[-1-l]:

        pass
    else:
        print("No")

        sys.exit()


if a == b:

    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
import math
S = input()
N = len(S)
flag = True

leftS = S[0:math.floor((N - 1)/2)]
rightS = S[math.floor((N + 3)/2) - 1:N]

def isPalindrome(str):
    N =len(str)
    flag = True
    for i in range(0,math.floor(N/2)):
        if str[i] != str[(N-1) - i]:
            flag = False
            break
    return flag

flag = isPalindrome(S)
if flag:
	flag = isPalindrome(leftS)
if flag:
	flag = isPalindrome(rightS)

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

Submission status: Accepted

Solution code:
S = list(input())
n = (len(S)-1)//2
m = 0
for i in range(n):
  if S[i] == S[-(i+1)] and S[i] == S[i+n+1]:
    continue
  else:
    print('No')
    m = 1
    break
if m < 1:
  print('Yes')

Submission status: Accepted

Solution code:
S=str(input())
N=len(S)
M=int((N-1)/2)
sum=0
for i in range(N):
    if S[i]==S[-1-i]:
        sum += 1
for i in range(M):
    if S[i]==S[M-i-1]:
        sum += 1
for i in range(M+1,N):
    if S[i]==S[M-i]:
        sum += 1
if sum==2*N-1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
S_rvs = S[::-1]
N = len(S)
left = int((N-1)/2)
right = int((N+3)/2-1)

if S == S_rvs and S[:left] == S_rvs[right:] and S[right:] == S_rvs[:left]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# input
S = input()

# check
N = len(S)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

N = len(S)

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

print("Yes")

Submission status: Accepted

Solution code:
def is_kaibun(s):
    front = 0
    back = len(s) - 1
    for _ in range(len(s)//2):
        if s[front] != s[back]:
            return False
        front += 1
        back -= 1
    return True

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

Submission status: Accepted

Solution code:
s=list(input())
t=list(reversed(s))
p=s[:(len(s) - 1) // 2]
q=list(reversed(p))
#r=s[(len(s) - 1) // 2:]
#u=list(reversed(r))
if s == t:
    if p == q:
        
        print("Yes")
        
    else:
        print("No")
    
else:
    print("No")

Submission status: Accepted

Solution code:
s =input()
l = len(s)
s = list(s)
revs=s[::-1]



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

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
a=round((n-1)/2)
rs=s[-1::-1]
s_s=s[:a]

s_rs=rs[:a]



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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
mae = (n-1)//2
usiro = (n+3)//2

for i in range(mae):
  if s[i] != s[mae-1-i] or s[i] != s[usiro-1+i]:
    print("No")
    exit()
    
for i in range(usiro-1, n):
  if s[i] != s[n-1+usiro-1-i]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
moji = list(input())
length = len(moji)
count = 0
m = n = 0

for i in range(int(length/2-1)):
    if moji[i] != moji[length-i-1]:
        count += 1
k = (length-1)//2-1
for i in range(int((length-1)/2-1)):
    if moji[i] != moji[k-n]:
        count += 1
    n += 1
n = (length+3-1)/2 
for n in range(int(length-1)):
    if moji[n] != moji[length-1-m]:
        count += 1
    m += 1
if count == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys;input=lambda:sys.stdin.readline().rstrip();aint=lambda:int(input());ints=lambda:list(map(int,input().split()))
import math;floor,ceil=math.floor,math.ceil
from collections import deque
Yes=lambda b:print('Yes')if b else print('No');YES=lambda b:print('YES')if b else print('NO')
is_even=lambda x:True if x%2==0 else False

def is_palindrome(s):
  n=len(s);ans=True
  for i in range(int(0.5*n)):
    if s[i]!=s[n-i-1]:
      ans=False
  return ans

def main():
  s=input();n=len(s)
  Yes(is_palindrome(s)and is_palindrome(s[:int(0.5*(n-1))]))
  

if __name__ == '__main__':
  main()

Submission status: Accepted

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

if S == S[::-1]:
    if S[0:(N-1)//2] == ''.join(list(reversed(S[0:(N-1)//2]))):
        if S[(N+3)//2-1:N] == ''.join(list(reversed(S[(N+3)//2-1:N]))):
            print('Yes')
            exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
len = (len(s)-1) //2
s_mae = s[0:len]
s_ato = s[len+1:]

flag = True
for i in range(len):
    if s_mae[i] != s_ato[i]:
        flag = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def isKaibun(s):
    r = s[::-1]
    for i in range(len(s)):
        if s[i] == r[i]:continue
        else: return False
    return True

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

Submission status: Accepted

Solution code:
str=(input())
l=len(str)
c=(l+1)/2
str1=""
str2=""
for i in range(l):
    if i<c-1:
        str1+=str[i]
    elif i>=c:
        str2+=str[i]
if(str1==str2):print("Yes")
else: print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

S1 = input()
N = len(S1)
S2 = S1[:(N - 1) // 2]
S3 = S1[(N + 3) // 2 - 1:]
is_stroing_palindrome = all([is_palindrome(S1), is_palindrome(S2), is_palindrome(S2)])

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

Submission status: Accepted

Solution code:
s = input()

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

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

if kaibun(s) and kaibun(t) and kaibun(u):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

def plindrome_checker(strings):
    result = True
    length = len(strings)
    for k in range(length):
        if (strings[k] == strings[length-1-k]):
            pass
        else:
            result = False
    return result

str0 = plindrome_checker(S)
str1 = plindrome_checker(S[0:(N-1)//2])
str2 = plindrome_checker(S[(N-1)//2+1:])

if(str0 and str1 and str2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
t=s[ : : -1]
n=len(s)
x=int((n-1)/2)
if s==t:
  a=s[:x]
  b=a[ : : -1]
  if a==b:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:

s = list(input())
t1 = []
t2 = []
t1 = s[0:int((len(s)-1)/2)]
t2 = s[int((len(s)-1)/2)+1:]

sr = s.copy()
sr.reverse()
t1r = t1.copy()
t2r = t2.copy()
t1r.reverse()
t2r.reverse()

if s == sr and t1 == t1r and t2 == t2r:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def isPalindrome(words ,start, end):
  i = start - 1
  j = end - 1
  while i < j :
    if words[i] != words[j]:
      return False
    i+=1
    j-=1

  return True

S = list(input())
N = len(S) #words length

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