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=list(input())
n=len(s)
if list(s[::-1])==list(s[:]) and list(s[(n-1)//2-1::-1])==list(s[:(n-1)//2]) and list(s[:(n+3)//2-2:-1])==list(s[(n+3)//2-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 - 1) // 2 + 1:] == S[(N - 1) // 2 + 1:][::-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
# list関数を使う
n = len(s)
list_s = list(s)
list_s_part1 = list_s[0:(n - 1) // 2]
list_s_part2 = list_s[(n + 1) // 2:n]
# 各種listを逆順に並び替える
list_s_rev = list(reversed(list_s))
list_s_part1_rev = list(reversed(list_s_part1))
list_s_part2_rev = list(reversed(list_s_part2))
if ''.join(list_s) == ''.join(list_s_rev) and\
    ''.join(list_s_part1) == ''.join(list_s_part1_rev) and\
    ''.join(list_s_part2) == ''.join(list_s_part2_rev):
    print('Yes')
else: print('No')

Submission status: Accepted

Solution code:
def check(a):
  for i in range(int(len(a)/2)):
    if a[i]!=a[-(i+1)]:
       return False
  return True
 
S=input()
if check(S):
  a=S[0:int(len(S)/2)]
  b=S[int(len(S)/2)+1:len(S)]
  if check(a) and check(b):
    print('Yes')
  else:
    print('No')
else:
    print('No')

Submission status: Accepted

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

S=input()
if kaibun(S):
    a=S[0:int(len(S)/2)]
    b=S[int(len(S)/2)+1:len(S)]
    if kaibun(a) and kaibun(b):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
m = n//2
s_f = []
s_l = []
for i in range(m):
    s_f.append(s[i])
for i in range(1,m + 1):
    s_l.append(s[-i])
s_r = list(reversed(s))
s_f_r = list(reversed(s_f))
s_l_r = list(reversed(s_l))
if s_r == s:
    if s_f_r == s_f and s_l_r == s_l:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

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

    rule1 = True
    rule2 = True
    rule3 = True

    for i in range(n):
        if s[i] != s[n - 1 - i]:
            rule1 = False
            break

    for i in range(n // 2):
        if s[i] != s[n // 2 - 1 - i]:
            rule2 = False
            break

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

    if rule1 and rule2 and rule3:
        ans = "Yes"
    else:
        ans = "No"

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = list(input())
if s == list(reversed(s)) and s[:len(s)//2] == list(reversed(s[:len(s)//2])):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S=input()
new_S1=list(reversed(S))
new_S2=''.join(new_S1)
if S==new_S2:
    A=S[0:len(S)//2]
    new_A1 = list(reversed(A))
    new_A2 = ''.join(new_A1)
    B=S[len(S)//2+1:len(S)]
    new_B1 = list(reversed(B))
    new_B2 = ''.join(new_B1)
    if A==new_A2 and B==new_B2:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
def partpall(s,n):
	if s!=s[::-1]:
		return False
	else:
		return True

def pall(s,n):
	if s!=s[::-1]:
		return False
	return partpall(s[n//2 +1 :],n) and partpall(s[:n//2 ],n)


# s=input("enter:")
s=input()
# print("sucess",s,s[::-1])
# revStr=s[::-1]
n=len(s)
# print(n)
if pall(s,n):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
S = input()

S_list = list(S)
N = len(S_list)
#print(N)
no_flag = 0

for i in range(N//2):
    if S_list[i] != S_list[N-i-1]:
        no_flag = 1

for i in range(int((N-1)/2)//2):
    #print(S_list[i], S_list[(N-1)//2-i-1])
    if S_list[i] != S_list[(N-1)//2-i-1]:
        no_flag = 1

for i in range((N-3)//2):
    #print(S_list[(N+3)//2+i-1], S_list[N-1-i])
    if S_list[(N+3)//2+i-1] != S_list[N-1-i]:
        no_flag = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check(r):
    if r == r[::-1]:
        return True


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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


def check(r):
    if r == r[::-1]:
        return True


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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
s = read().decode("utf-8")
H = s[:(len(s) - 1) // 2]
B = s[(len(s) - 1) // 2 + 1:-1]

if s[:-1] == s[:-1][::-1] and H == H[::-1] and B == B[::-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:]

count=0
for i in range(n//2):
    if s[i]==s[-(i+1)]:
        count+=1
for i in range((n-1)//2):
    if s2[i]==s2[-(i+1)]:
        count+=1
for i in range(n-(n+3)//2+1):
    if s3[i]==s3[-(i+1)]:
        count+=1

if count==n//2+(n-1)//2+n-(n+3)//2+1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

def solve():
	s=input()
	if(len(s)%2==0):
		print("No")
		return 
	else :
		n=len(s)//2
		str1=s[:n]
		str2=s[n+1:]
		# print(str1,str2)
		if(str1==str2):
			print("Yes")
		else:
			print("No")
if __name__ == "__main__":
	solve()

Submission status: Accepted

Solution code:
import sys
S=list(input())
reverse_S = S[::-1]

if S==reverse_S:
    for i in range(int(len(S)/2)):
        if S[i]==S[int(len(S)/2)-i-1] and S[int(len(S)/2)+1+i]==S[len(S)-1-i]:
            continue
        else:
            print("No")
            sys.exit()
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
r_S=S[::-1]
c1=int((N-1)/2)
c2=int((N+3)/2)
S1=S[:c1]
r_S1=S1[::-1]
S2=S[(c2-1):]
r_S2=S2[::-1]


#kaibun hantei
if S==r_S and S1==r_S1 and S2==r_S2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def resolve():
    def is_rotatable(S):
        for i in range(len(S)//2):
            if S[i] != S[-1-i]:
                return False
        return True
    S = input()
    N = len(S)
    if is_rotatable(S) and is_rotatable(S[:N//2]) and is_rotatable(S[(N//2)+1:]):
        print("Yes")
    else:
        print("No")


if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
S = input()
N = len(S)
reverse = S[::-1]
first = S[:(N - 1) // 2]
second = S[(N + 1) // 2:]

if S == reverse and first == second:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

first = S[:(length - 1) // 2]
second = S[(length + 1) // 2:]
#print(first)
#print(second)

if check_palin(S) and check_palin(first) and check_palin(second):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

def rule1():
  return S==S[::-1]

def rule2():
  s = S[:(N-1)//2]
  return s==s[::-1]

def rule3():
  s = S[(N+3)//2-1:]
  return s==s[::-1]  

print ('Yes' if rule1() and rule2() and rule3() else 'No')

Submission status: Accepted

Solution code:
s = list(input())

f1 = s == list(reversed(s))
f2 = s[:(len(s)-1)//2] == list(reversed(s[:(len(s)-1)//2]))
f3 = s[(len(s)+2)//2:] == list(reversed(s[(len(s)+2)//2:]))
print("Yes" if all([f1, f2, f3]) else "No")

Submission status: Accepted

Solution code:
S = input()

flag = 0
for i in range(0, len(S), 1):
	if S[i] != S[len(S)-1-i]:
		flag = 1

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

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':

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

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

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def main():
    S = input()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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

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

print('Yes')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

print(check())

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
S_list=[]
for i in S:
    S_list.append(i)   
rS_list = list(reversed(S_list))
second_list = S_list[:(int((N-1)/2))]
#print(f'second: {second_list}')
rsecond_list = list(reversed(second_list))
third_list = S_list[(int(((N+3)-1)/2)):N]
#print(f'third: {third_list}')
rthird_list = list(reversed(third_list))
if S_list == rS_list:
    #print(f'壱: OK')
    if second_list == rsecond_list:
        #print(f'弐: OK')
        if third_list == rthird_list:
            #print(f'参: OK')
            print('Yes')       
    else:
            print('No')   
else:
            print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
S=input()
N=len(S)
if S[:N//2]==S[N//2+1:][::-1]:
  if N==3:
    print("Yes")
  elif (N//2)%2==1:
    if S[:(N//2)//2]==S[(N//2)//2+1:N//2][::-1] and S[N//2+1:-(N//2)//2]==S[-(N//2)//2+1:][::-1]:
      print("Yes")
    else:
#      sys.stderr.write("2\n")
      print("No")
  else:
    if S[:(N//2)//2]==S[(N//2)//2:N//2][::-1] and S[N//2+1:-(N//2)//2]==S[-(N//2)//2:][::-1]:
      print("Yes")
    else:
      print("No")
else:
#  sys.stderr.write("1\n")
  print("No")

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

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


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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# ABC159
# String Palindrome
S = input()
n = len(S)
n
m = int(((n - 1)/2)-1)
l = int(((n + 3)/2)-1)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3
import sys
input = lambda: sys.stdin.readline().strip()
def pal(s, L, R):
    return s[L] == s[R] and (L >= R or pal(s, L + 1, R - 1))

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

Submission status: Accepted

Solution code:
# String Palindrome
def is_palindrome(s):
    res = s == s[::-1]
    return res

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = input()
l = len(w)
flag = True
for i in range((l - 1)//2):
  if w[i] != w[l - i - 1]:
    flag = False
    break
mid = (l - 1) // 2
mid_mid = mid // 2
for i in range(mid_mid + 1):
  if w[i] != w[mid - i - 1] or not flag:
    flag = False
    break
  if w[i + mid + 1] != w[l - i - 1]:
    flag = False
    break
if flag:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s=input()
n=len(s)
a=s[0:(n-1)//2]
b=s[(n+3)//2-1:n]
c=a[::-1]
d=b[::-1]
sr=s[::-1]
for i in range(n):
    if s[i]==sr[i]:
        pass
    else:
        print("No")
        exit()
for i in range(len(a)):
    if a[i]==c[i]:
        pass
    else:
        print("No")
        exit()
for i in range(len(b)):
    if b[i]==d[i]:
        pass
    else:
        print("No")
        exit()
print("Yes")

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
    print('No')

Submission status: Accepted

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

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

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

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

Submission status: Accepted

Solution code:
s = input()

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

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

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

print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

ans = "Yes"
str = input()

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

Submission status: Accepted

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



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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=input()

b=len(a)

c=(b-1)/2

d=(b+1)/2

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

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

Submission status: Accepted

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

import sys
input=sys.stdin.readline
import itertools

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

if __name__=="__main__":
    main()

Submission status: Accepted

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

import sys
input=sys.stdin.readline
import itertools

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

if __name__=="__main__":
    main()

Submission status: Accepted

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

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

result = CheckPalindrome(S, L)

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

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

print('Yes')

Submission status: Accepted

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

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

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

S = input()

def is_kaibun(s):
    l = len(s)
    # print('former', s[:int(l/2)])
    # print('latter', s[:-(int(l/2))-1:-1])
    if s[:int(l/2)] == s[:-(int(l/2))-1:-1]:
        return True
    else:
        return False

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

Submission status: Accepted

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

s = str(input())
n = len(s)
moji1 = int((n - 1) / 2)
moji2 = int((n + 3) / 2)
#print(s[:moji1])
#print(s[moji2-1:])
if kaibun(s) and kaibun(s[:moji1]) and kaibun(s[moji2-1:]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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