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 = input()
N = len(S)
T = list(S)
M = (N-1)/2
i = 0
j = int(M)

if j%2 == 1:
    while i == j-1 or i == j:
        if T[i] != T[j-1]:
            j = -1
            break
        i += 1
        j -= 1
        
P = int((N+3)/2)
i = 0
while P < N+1:
    if T[i] != T[P-1]:
        j = -1
        break
    i += 1
    P += 1

if j != -1:
    print('Yes')
else :
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
T = list(S)
Tlength = len(S)
N = int((len(S)-1)/2)
halfN1=int(N/2)
halfN2=int((Tlength+N)/2)
check=0
#print(T[Tlength-2])
#print(N)
#print(halfN1)
#print(halfN2)
for i in range(0,N):
    if T[i]!=T[Tlength-1-i]:
        check=1
        break
for i in range(0,halfN1):
    if T[i]!=T[N-1-i]:
        check=1
        break
for i in range(0,halfN1):
    if T[N+1+i]!=T[Tlength-1-i]:
        check=1
if check==1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
S = input()
N = len(S)
flg = True
i = 0
while i <= (N-3)/2:
    if S[i]!=S[int((N-3)/2-i)]:
        flg = False
    i += 1
i = N-1
while i >= (N+1)/2:
    if S[i]!=S[int((3*N-1)/2-i)]:
        flg = False
    i -= 1
i = 0
while i <= N-1:
    if S[i]!=S[N-1-i]:
        flg = False
    i += 1
if flg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
N = len(S)
T = list(S)
i = 0
chack = 0

while i != int((N-1)/2):
    if T[i] != T[N-i-1]:
        chack = 1
        break
    else:
        i = i+1

i = 0
while i != int((N-1)/4):
    if T[i] != T[int((N-1)/2-i-1)]:
        chack = 1
        break
    else:
        i = i+1

i = 0
while i != int((N-1)/4):
    if T[int((N+1)/2)+i] != T[N-i-1]:
        chack = 1
        break
    else:
        i = i+1

if chack == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def checkpalindrome(s):

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

    return True

S =  input()

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

Submission status: Accepted

Solution code:
s =str(input())
if s == s[::-1]:
  n = int((len(s)-1)/2)
  half_s = s[0:n] 
  if half_s == half_s[::-1]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
a = s[:4]
done = False
if s == s[::-1]:
    if s[:(n - 1) //2] == s[:(n - 1) //2][::-1]:
        if s[(n + 1) // 2:] == s[(n + 1) // 2:][::-1]:
            print('Yes')
            done = True
if not done:
    print('No')

Submission status: Accepted

Solution code:
from sys import stdin
r = stdin.readline

def is_palin(t):
    ans, n = True, len(t)
    for i in range((n//2)+1):
        if t[i]!=t[n-i-1]: ans=False; break
    return ans

def main():
    t = r().strip()
    n = len(t)
    print("Yes" if is_palin(t) and is_palin(t[:((n-1)//2)]) and is_palin(t[(n+2)//2:]) else "No") 

main()

Submission status: Accepted

Solution code:
s=input()
n=len(s)
 
flag=True
 
for i in range(n):
  if(s[i]!=s[n-1-i]):
    flag=False
 
for i in range((n-1)//2):
  if(s[i]!=s[(n-1)//2-1-i]):
    flag=False
  if(s[(n-1)//2+1+i]!=s[n-1-i]):
    flag=False
    
if(flag):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
S = input()
N = len(S)
n1 = (N-1)//2 -1
n2 = (N+3)//2 - 1
if S == S[::-1]:
  if S[:n1+1] == S[:n1+1][::-1]:
    if S[n2:] == S[n2:][::-1]:
      print('Yes')
    else:
      print('No')
  else:
    print('No')     
else:
  print('No')

Submission status: Accepted

Solution code:
sente=input()
n=len(sente)
nt=int((n-1)/2)
nb=int((n+3)/2)
#print(nt,nb)
#print(sente[nb:n])
if sente == sente[::-1]:
    if sente[0:nt] == sente[0:nt][::-1]:
        #print(sente[0:nt])
       
        if sente[nb-1:n]==sente[nb-1:n][::-1]:
            #print(sente[nb-1:n])

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

Submission status: Accepted

Solution code:
str = input()

str1 = str[::-1]
a = str1 == str
str2 = str[:int((len(str)-1)/2)]
str3 = str2[::-1]
b = str3 == str2
str4 = str[int((len(str)+3)/2)-1:]
str5 = str4[::-1]
c = str5 == str4
if a and b and c:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def isPalindrome(string):
    reverse = string[::-1]
    if(string == reverse):
        return True
    return False
string = input()
if(isPalindrome(string) and isPalindrome(string[0:int((len(string)-1)/2)]) and isPalindrome(string[int((len(string)+3)-1/2):])):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = str(input())
Reverse_S = S[::-1]
N = len(S)
R = S[:(N-1)//2]
Reverse_R = R[::-1]
L = S[N+3//2:]
Reverse_L = L[::-1]

if S==Reverse_S and R==Reverse_R and L==Reverse_L:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

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

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)

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

s1_rev = s1[::-1]
s2_rev = s2[::-1]

if s == s[::-1]:
    if s1 == s1_rev and s2 == s2_rev:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
a = input()
if len(a) % 2 == 0:
    print('No')
else:
    N = int((len(a) - 1) / 2)
    if a[:N] == a[-N:] == a[:N:-1]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
s_re = list(reversed(s))
n = len(s)
s2 = [s[i] for i in range((n-1)//2 )]
s2_re = list(reversed(s2))
s3 = [s[i] for i in range((n+3)//2 - 1,n)]
s3_re = list(reversed(s3))
if (s == s_re) and (s2 == s2_re) and (s3 == s3_re):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
ls = list(s)
ls1 = ls[:int((len(ls)-1)/2)]
ls2 = ls[int((len(ls)+3)/2) - 1:]
def kt(l):
    lr = list(reversed(l))
    if l == lr:
        return 1
    else:
        return 0
a = kt(ls)
b = kt(ls1)
c = kt(ls2)


d = a + b + c

if d >= 3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
H = len(S)//2

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

Submission status: Accepted

Solution code:
S = list(input())
# print(S)
FS = S[:int((len(S) - 1)/ 2)]
BS = S[int((len(S) + 3) / 2) -1:]

r_S = list(reversed(S))
r_FS = list(reversed(FS))
r_BS = list(reversed(BS))
flag = 0

for i in range(len(S)):
    # print(r_FS, BS)
    if r_S[i] == S[i] and r_FS == FS and r_BS == BS:
        flag = 1

        continue
    else:
        print('No')
        flag = 0
        break
    
if flag == 1:
    print('Yes')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
head_n = int((n-1)/2)
head_s = s[:head_n]
# print(head_s)
foot_n = int((n + 3) / 2 -1)
foot_s = s[foot_n:]
# print(foot_s)

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

Submission status: Accepted

Solution code:
def gattai(s):
	g = ""
	for j in s:
		g += j
	return g

def judge(S, N):
	# 真ん中より左 list型なのでgattaiさせる
	S1 = gattai(S[:int(N / 2)])
	# 真ん中より右
	S2 = gattai(S[int(N / 2 + 1):])
	if S1 == S2:
		if S1 == S1:
			if S2 == S2:
				return "Yes"
	return "No"

S = list(input())
N = len(S)
print(judge(S, N))

Submission status: Accepted

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

Submission status: Accepted

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


# rule 1 
def kaibun(s):
    n = len(s)
    l = s
    r = s[::-1]
    if l == r:
        return True
    else:
        return False

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

Submission status: Accepted

Solution code:
def P(S):
    T = S[::-1]
    return True if S == T else False

S = input()
N = len(S)
T = S[:N//2]

if P(S) == False or P(T) == False:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
input_ = input()
length = int(len(input_))
if length%2==0:
  print('No')
  exit(0)
f,b = input_[:int((length-1)/2)],input_[int((length-1/2)):]
str_ = [input_,f,b]
for s in str_:
  #print(s)
  if s==''.join(list(reversed(s))): pass
  else:
    print('No')
    exit(0)
print('Yes')

Submission status: Accepted

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

if not S == S[::-1]:
    is_strong_palindrome = False

S_head = S[:(N-1)//2]
if not S_head == S_head[::-1]:
    is_strong_palindrome = False

S_tail = S[:(N-1)//2]
if not S_tail == S_tail[::-1]:
    is_strong_palindrome = False

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
def is_kaibun(a,b):#ind a~b
    for i in range(a,b+1):
        if i>=b-i:
            break
        if S[i]!=S[b-i]:
            return False
    return True
if is_kaibun(0,(N-3)//2) and is_kaibun((N+1)//2,N-1) and is_kaibun(0,N-1):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ok():
    print("Yes")
    return

def ng():
    print("No")
    exit()
    return


s=input()
n=len(s)
if s!=s[::-1]:ng()
s1=s[:n//2]
if s1!=s1[::-1]:ng()

ok()

#otamesi

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    s = input()
    n = len(s)

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

S=list(input())
N=len(S)
print('Yes' if P(S) and P(S[:N//2]) and P(S[N//2+1:]) else 'No')

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    flag = True
    for idx in range(len(S)//2):
        if S[idx] != S[-idx-1]:
            flag = False
    N = len(S)
    for idx in range((N+1)//4):
        if S[idx] != S[(N-1)//2 - 1 - idx]:
            flag = False
        if S[idx + (N - 1)// 2 + 1] != S[N - 1 - idx]:
            flag = False

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
count=0
s=input()
len_s=len(s)
center=int((len_s-1)/2+1)
s_former=s[0:center-1]
s_leter=s[center:]
for a in range(int((len(s)-1)/2-1)):
    if(s[a]==s[-1-a]):
        pass
    else:
        count+=1
for a in range(int((len(s_former)+1)/2)):
    if(s_former[a]==s_former[-1-a]):
        pass
    else:
        count+=1
for a in range(int((len(s_leter)+1)/2)):
    if(s_leter[a]==s_leter[-1-a]):
        pass
    else:
        count+=1
if(count==0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = list(input())

if s == s[-1::-1]:
    s.insert(0, 'Z')
    a = s[1:(len(s)-1)//2+1]
    b = s[(len(s)+3)//2:]

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

Submission status: Accepted

Solution code:
s=input()

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

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

if flag:
    print('Yes')

else:
    print('No')

Submission status: Accepted

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

sr = s[::-1]
ans = 'Yes'
if s != sr :
  ans = 'No'
  
s1 = s[0:(n-1)//2]
sr = s1[::-1]
if s1 != sr :
  ans = 'No'
  
s2 = s[(n+3)//2-1:n]
sr = s2[::-1]
if s2 != sr :
  ans = 'No'
  
print(ans)

Submission status: Accepted

Solution code:
a= str(input())
kaibun = list(a)
n = int(len(kaibun))
answer = "No"
strongn1 = int((n-1)/2)
strongn2 = int((n+3)/2)
for i in reversed(range((int((n+1)/2)),n)):
    if kaibun[i] == kaibun[n-i-1]:
        answer = "Yes"
    else:
        answer = "No"
        break

if answer == "Yes":
    for i in range(int(strongn1/2)):

        if kaibun[i] == kaibun[strongn1-i-1]:
            answer = "Yes"
        else:
            answer="No"
            break
if answer == "Yes":
    for i in reversed(range(strongn2+int(strongn1/2)-1,n)):
        if kaibun[i] == kaibun[strongn2-2-i+n]:
            answer = "Yes"
        else:
            answer = "No"
            break
print(answer)

Submission status: Accepted

Solution code:
S = str(input())

#print(S)
#print(S[0])

def check_Palindrome(S):
#    N = len(S)
#    S_1 = S[:int((N-1)/2)] #9文字なら前半は1～4文字⇒0:4
#    S_2 = ''.join(list(reversed(S[int((N+1)/2):]))) #後半は6～9⇒5:
#    if S_1 == S_2:
#        return 1
#    else:
#        return 0
    return S == S[::-1]

#print(check_Palindrome(S))
N = len(S)
# Sの1文字目から（N-1)/2文字目まで⇒Sが9文字なら1～4⇒S[:4]
S_check2 = S[:int((N-1)/2)]
# Sの(N+3)/2文字目からN文字目まで⇒Sが9文字なら6～9⇒S[5:]
S_check3 = S[int((N+3)/2-1):]

if (check_Palindrome(S) == 1) & (check_Palindrome(S_check2) == 1) & (check_Palindrome(S_check3) == 1):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    a = input()
    a_len = len(a)
    # check1
    top_s = a[:int((a_len-1)/2)]
    tail_s = a[int((a_len+3)/2)-1:]
    if a ==  ''.join(list(reversed(a))) and top_s == ''.join(list(reversed(top_s))) and tail_s == ''.join(list(reversed(tail_s))):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

A = str(s[:(n-1)//2])
B = str(s[(n+3)//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)
if S[:int((N-1)/2)]==S[int((N-1)/2)-1::-1] and S[int((N+3)/2)-1:]==S[:int((N+3)/2)-2:-1] and S==S[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
X = input()
X1 = X[::-1]
y1 = (len(X)-1)/2
X2 = X[:int(y1)]
X21 = X2[::-1]
y2 = (len(X)+3)/2
X3 = X[int(y2)-1:]
X31 = X3[::-1]
if X==X1 and X2==X21 and X3==X31:
  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-i-1] or s[i] != s[(n-1)//2-i-1] or s[i+(n+1)//2] != s[n-i-1]:
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
S=input()
N=int(len(S))
C=int(0)
for i in range(N):
    if(S[i]!=S[N-1-i]):
        C=1
        print('No')
        break
if C==0:
    for i in range(int((N-1)/2)):
        if(S[i]!=S[int(((N-1)/2)-1-i)]):
            C=1
            print('No')
            break
if C==0:
    print('Yes')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 入力
s = input()

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

if len(s) < 3:
  ans = 'No'
else:
  if kaibun(s):
    s_half = s[:(len(s)-1)//2]
    if kaibun(s_half):
      ans = 'Yes'
    else:
      ans = 'No'
  else:
    ans = 'No'
    
print(ans)

Submission status: Accepted

Solution code:
s = input()
lis = list(s)
ans = ""
s_rev = ""
s1 = ""
s1_rev = ""
s2 = ""
s2_rev =""
n = len(s)

def check(s,t):
    if s == t:
        return True
    else:
        return False

for i in range(n):
    s_rev+=lis[n-i-1]
for i in range(0,int((n-1)/2),1):
    s1+=lis[i]
    s1_rev+=lis[int((n-1)/2)-i-1]
for i in range(int((n+1)/2), n, 1):
    s2+=lis[i]
    s2_rev+=lis[int((n+1)/2)-i-1]

tf1 = check(s,s_rev)
tf2 = check(s1,s1_rev)
tf3 = check(s2,s2_rev)
if tf1 == True and tf2 == True and tf3 == True:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Accepted

Solution code:
#template
def inputlist(): return [int(i) for i in input().split()]
#template
#issueから始める
S = list(input())
sa = S[:]
sa.reverse()
n = len(S)
ss = S[:(n-1)//2]
SS = S[(n+1)//2:]
ssaa = ss[:]
ssaa.reverse()
SSAA = SS[:]
SSAA.reverse()
if S == sa and ss == ssaa and SS == SSAA:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def is_palindrome(S, i, j):
    if i >= j:
        return True
    return S[i] == S[j] and is_palindrome(S, i + 1, j - 1)

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

Submission status: Accepted

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

if S == list(reversed(S)):
  if S[0:(N-1)//2] == list(reversed(S[0:(N-1)//2])):
    if S[(N+2)//2:] == list(reversed(S[(N+2)//2:])):
      isStrongPalindrome = True

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

Submission status: Accepted

Solution code:
def IsPalindrome(st):
    if len(st)%2==0:
        e = int(n/2-1)
    else:
        e = int((n-1)/2-1)
        
    for i in range(0, e):
        if st[i]!=st[-(i+1)]:
            return(False)
    return(True)


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


if IsPalindrome(s)==IsPalindrome(s1)==IsPalindrome(s2)==True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import math
text = input()
reply = "Yes"

if text != text[::-1]:
    reply = "No"

tmp = text[0:math.floor((len(text)-1)/2)]
if tmp != tmp[::-1]:
    reply = "No"

text = text[::-1]
tmp = text[0:math.floor((len(text) -1)/2)]
if tmp !=tmp[::-1]:
    reply = "No"

print(reply)

Submission status: Accepted

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

for i in range((N-1)//4):
    if S[i] == S[(N-1)//2-1-i] and S[(N+3)//2-1+i] == S[N-1-i]:
        continue
    else:
        flag = False
        break

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

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

Submission status: Accepted

Solution code:
s = input()
rs = s[::-1]
if s != rs:
  print("No")
  exit()
n = len(s)
m = int((n-1)/2)
l = int((n+1)/2)
if s[:m] != rs[l:]:
  print("No")
  exit()
if s[l:] != rs[:m]:
  print("No")
  exit()
print("Yes")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
fg1 = S == S[::-1]
T=S[:(N-1)//2]
fg2 = T == T[::-1]
U=S[(N+3)//2-1:]
fg3 = U == U[::-1]

if fg1 and fg2 and fg3:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

S = input()
N = len(S)


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


print('Yes' if all(is_palindrome(s) for s in [S, S[:(N - 1) // 2], S[(N + 3) // 2 - 1]]) else 'No')

Submission status: Accepted

Solution code:
s=list(input())
N=len(s)
for i in range(int((N-1)/2)):
  if s[i]!=s[N-1-i]:
    print("No")
    exit()
for i in range(int(((N-1)/2-1)/2+1)):
  if s[i]!=s[int((N-1)/2)-1-i]:
    print("No")
    exit()
for i in range(int(((N-1)/2-1)/2+1)):
  if s[int((N-1)/2)+1+i]!=s[N-1-i]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
ans = 'Yes'

#回文判定1
if S != S[::-1]:
  ans = 'No'

#回文判定2
tmp = S[:int((N-1)/2)]
if tmp != tmp[::-1]:
  ans = 'No'

#回文判定2
tmp = S[int((N+3)/2-1):]
if tmp != tmp[::-1]:
  ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
def is_palindrome(s: str) -> bool:
    return s[::-1] == s

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

Submission status: Accepted

Solution code:
import math

text = input()
reply = "Yes"

if text != text[::-1]:
    reply = "No"

tmp = text[0:math.floor((len(text) - 1) / 2)]
if tmp != tmp[::-1]:
    reply = "No"

text=text[::-1]
tmp = text[0:math.floor((len(text) - 1) / 2)]
if tmp != tmp[::-1]:
    reply = "No"

print(reply)

Submission status: Accepted

Solution code:

s = input()
len_s = len(s)
if s[:int((len_s-1) /2)] != s[int((len_s-1) / 2 +1):]:
    print('No')
else:
    tmp = s[:int((len_s -1 ) /2)]
    if len(tmp) == 1:
        print('Yes')
    else:
        if len(tmp ) %2 == 1:
            if tmp[:int((len(tmp) - 1) / 2)] == tmp[int((len(tmp) - 1) / 2 + 1):][::-1]:
                print('Yes')
            else:
                print('No')
        else:
            if tmp[:int(len(tmp) / 2)] == tmp[int(len(tmp) / 2):][::-1]:
                print('Yes')
            else:
                print('No')

Submission status: Accepted

Solution code:
from sys import *
from math import *
from collections import deque
input = stdin.readline
lmi = lambda: list(map(float, input().split()))
mi = lambda: map(int, input().split())
si = lambda: input().strip('\n')
ssi = lambda: input().strip('\n').split()

s = si()

def p(x):
    return x == x[::-1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check_palindrome(s):
  n = len(s)
  return all([s[i] == s[n - 1 - i] for i in range(n // 2)])


def main():
  s = input()
  n = len(s)
  print('Yes' if check_palindrome(s) and check_palindrome(s[:n // 2]) else 'No')


main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input().strip()
N=len(S)
count=0

if N%4==1:
    for i in range(int((N-1)/2)//2):
        if S[i] == S[int(((N-3)/2)-i)] and S[i] == S[int(((N+1)/2)+i)] and S[i] == S[N-1-i]:
           count+=1


elif N%4==3:
    for i in range(int((N-1)/2)//2):
        if S[i] == S[int(((N-3)/2)-i)] and S[i] == S[int(((N+1)/2)+i)] and S[i] == S[N-1-i] and S[int(((N-1)/2)//2)] == S[N-1-int(((N-1)/2)//2)]:
           count+=1

if count==int((N-1)/2)//2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input().strip()


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


def is_strong_palindrome(string):
    if not is_palindrome(string):
        return False
    n = len(string)
    if not is_palindrome(string[:(n - 1)//2]):
        return False
    if not is_palindrome(string[(n+3)//2 - 1:]):
        return False
    return True


if is_strong_palindrome(s):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = str(input())
for i in range(len(s)//2):
    if s[i] != s[-(i+1)]:
        print("No")
        exit()
for i in range(len(s)//4):
    if s[i] != s[(len(s)//2-i-1)]:
        print("No")
        exit()
for i in range(len(s) - (len(s)+3)//2):
    if s[(len(s)+3)//2+i-1] != s[-(i+1)]:
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

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

def resolve():
    readline=sys.stdin.readline

    #n,m,k=map(int, readline().rstrip().split())
    #arr=list(map(int, readline().rstrip().split()))
    #n=int(readline())
    ss=readline().rstrip()
    #yn(1)
    n=len(ss)
    yn(kaibun(ss) and kaibun(ss[0:(n-1)//2]) and kaibun(ss[(n+3)//2-1:n]))

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Accepted

Solution code:
GI = lambda: int(input()); GIS = lambda: map(int, input().split()); LGIS = lambda: list(GIS())

def is_palindrome(s):
    l = 0
    r = len(s) - 1

    while l < r:
        if s[l] != s[r]:
            return False
        l += 1
        r -= 1

    return True

def main():
    s = input()
    n = len(s)
    print(('No', 'Yes')[(is_palindrome(s) and is_palindrome(s[:n//2]) and is_palindrome(s[n//2+1:]))])

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# input
S = input()
N = len(S)
# calculate
if S==S[::-1] and S[0:int((N-1)/2)]==S[int((N-1)/2)-1::-1]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
def qq(s):
  return s==s[::-1]

if qq(s):
  if qq(s[:n//2]):
    if qq(s[n//2+1]):
      print("Yes")
      exit()
print("No")

Submission status: Accepted

Solution code:
# coding: utf-8

# 標準入力<str>
S = input()
N = len(S)
n = int((N - 1) / 2)
n2 = int((N - 1) / 2)
S2 = S[0:n2]
n3 = int((N+3)/2)
S3 = S[n3 -1:]

isNo1OK = True
isNo2OK = True
isNo3OK = True

for i in range(n):
  if S[i] != S[(i + 1) * -1]:
    isNo1OK = False

for j in range(len(S2)):
  if S2[j] != S2[(j + 1) * -1]:
    isNo2OK = False

for k in range(len(S3)):
  if S3[k] != S3[(k + 1) * -1]:
    isNo2OK = False

if isNo1OK and isNo2OK and isNo3OK:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

S = input()
n = len(S)
is_strong = True
if not is_palindrome(S):
    is_strong = False
if not is_palindrome(S[:(n - 1) // 2]):
    is_strong = False
if not is_palindrome(S[( n + 3) // 2 - 1:]):
    is_strong = False

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

Submission status: Accepted

Solution code:
#ABC159B
import sys
s = sys.stdin.readline().rstrip()
n = len(s)
#print(s)
#print(n)
a = s[:int((n-1)/2)]
b = s[int((n+3)/2-1):]

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

Submission status: Accepted

Solution code:
import sys
s=input()
n=len(s)
s_pre = s[:(n-1)//2]
s_epi = s[(n+1)//2:]
if s != s[::-1]:
    print('No')
    sys.exit()
if s_pre != s_pre[::-1]:
    print('No')
    sys.exit()
if s_epi != s_epi[::-1]:
    print('No')
    sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
#回文であるか調べる
def kaibuncheck(S):
    N=len(S)
    if N == 1:
        return 1

    N_val=N-1
    center=int((N-1)/2)
    checkpoint=0
    if N == 1:
        return 1
    for i in range(center-1):
        if S[i] == S[N_val]:
            checkpoint+=1
        N_val -= 1

    if checkpoint == center-1:
        return 1
    else:
        return 0

S = list(input())
N = len(S)
N2 = int((N-1)/2)

S_start=list()
S_end=list()
for i in range(N2):
    S_start.append(S[i])
    S_end.append(S[N2+1+i])

if N%2 == 1:
    if kaibuncheck(S) == 1 and kaibuncheck(S_start) == 1 and kaibuncheck(S_end) == 1:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
for i in range(N//2):
    if S[i] != S[-i-1]:
        print('No')
        exit()
if N % 2 == 0:
    print('No')
    exit()
tmp = (N-1)//2
for i in range(tmp):
    if S[i] != S[tmp-i-1]:
        print('No')
        exit()
tmp = (N+3)//2
for i in range(tmp, N):
    if S[i] != S[N-i-1]:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
s = input()

div = len(s) // 2
pre = s[:div]
suf = s[div + 1:]

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