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 = ""

def format_input(filename = None):
	global s
	if filename == None:
		s = input()

	elif filename == '__random__':
		from random import randint as rng
		from random import choices
		s = ''.join(choices('abcdefghijklmnopqrstuvwxyz', k = rng(3, 99)))

def get_answer():
	answer = 'No'
	n = len(s)
	rev_s = ''.join(list(reversed(s)))
	for_s = s[:(n-1)//2]
	rev_for_s = ''.join(list(reversed(for_s)))
	lat_s = s[(n+3)//2-1:]
	rev_lat_s = ''.join(list(reversed(lat_s)))
	if s == rev_s and for_s == rev_for_s and lat_s == rev_lat_s:
		answer = 'Yes'
	return answer

if __name__ == '__main__':
	format_input()

	ans = get_answer()
	print(ans)

Submission status: Accepted

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

Submission status: Accepted

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




def main():
    S = input()
    N = len(S)

    ans = 'Yes'
    if not iskaibun(S): ans = 'No'
    if not iskaibun(S[:N//2]): ans = 'No'
    if not iskaibun(S[N//2+1:]): ans = 'No'
    print(ans)

    return

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()

def palind(word):
    l = len(word)
    i=0
    j=l-1 
    while i <= j:
        if word[i] != word[j]:
            return False
        i += 1
        j -= 1
    return True

n = len(s)

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

Submission status: Accepted

Solution code:
import math
S = input()

def check(S):
    if S == S[::-1]:
        N = len(S)
        end = math.floor(((N-1)/2))
        s2 = S[:end]
        if s2 == s2[::-1]:
            start = math.floor((N+3)/2)
            s3 = S[start-1:N]
            if s3 == s3[::-1]:
                return "Yes"
    return "No"

print(check(S))

Submission status: Accepted

Solution code:
s = input()
n = len(s)
mid = (n + 1) // 2
ans = 'Yes'
if s != s[::-1]:
    ans = 'No'
#print(1, ans)

#print(s[:(n - 1) // 2])
#print(''.join(list(reversed(s[:(n - 1) // 2]))))
if s[:(n - 1) // 2:] != ''.join(list(reversed(s[:(n - 1) // 2]))):
    ans = 'No'
#print(2, ans)

#print(s[(n + 2) // 2::])
#print(''.join(list(reversed(s[(n + 2) // 2::]))))
if s[(n + 2) // 2:n:] != ''.join(list(reversed(s[(n + 2) // 2::]))):
    ans = 'No'
#print(3, ans)
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()
l = int(len(s))
ans = "Yes"

for i in range(int((l - 1) / 2)):
    if s[i] != s[-1 - i]:
        ans = "No"

half = int((l - 1) / 2)
s1 = s[0:half]
s2 = s[half + 1:]

if half % 2 == 0:
    for i in range(int(half / 2)):
        if s1[i] != s1[-1 - i]:
            ans = "No"
        if s2[i] != s2[-1 - i]:
            ans = "No"
else:
    for i in range(int((half - 1) / 2)):
        if s1[i] != s1[-1 - i]:
            ans = "No"
        if s2[i] != s2[-1 - i]:
            ans = "No"

print(ans)

Submission status: Accepted

Solution code:
# print('input >>')

S = input()

N = len(S)

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

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

# print('-----output-----')

Submission status: Accepted

Solution code:
S = input()

N = len(S)
S_rev = ''.join(list(reversed(S)))

S_cond1 = S[0:int((N-1)/2)]
S_cond1_rev = ''.join(list(reversed(S_cond1)))

S_cond2 = S[int((N+3)/2)-1:]
S_cond2_rev = ''.join(list(reversed(S_cond2)))

if(S == S_rev and S_cond1 == S_cond1_rev and S_cond2 == S_cond2_rev):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

def solve(S):
  n = len(S)
  if n%2:
    l = (n-1)//2
    if ispal(S) and ispal(S[:l]) and ispal(S[l+1:]):
      return 'Yes'
  	
    return 'No'
  else:
    return "No"
S = input()
print(solve(S))

Submission status: Accepted

Solution code:
s = input()
n = len(s)
a = int((n-1)/2)
b = int((n+3)/2)-1
def ispalindrome(str): return 1 if str == str[::-1] else 0

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
s1=s[:(n-1)//2]
s2=s[(n+3)//2-1:n]
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)

index1 = (n-1)//2
index2 = (n+3)//2

flag = True

if s == s[::-1]:
    if s[:index1] == s[:index1][::-1]:
        if s[index2-1:] == s[index2-1:][::-1]:
            print('Yes')
            flag = False
        
if flag:
    print('No')

Submission status: Accepted

Solution code:
s = input()

n = len(s)

firsthalf = s[:(n - 1)//2]
secondhalf = s[(n + 3)//2 - 1:]
#
# print(firsthalf)
# print(secondhalf)

revfirst = firsthalf[::-1]
revsecond = secondhalf[::-1]
revitself = s[::-1]
#
# print(revfirst)
# print(revsecond)

if s == revitself and firsthalf == revfirst and secondhalf == revsecond:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#B
s = input()

def palindrome(start,end):
    isT = True
    for i in range(start, int((start+end+1)/2)):
        if s[i] != s[end-i]:
            isT = False
    return (isT)


final = palindrome(0,len(s)-1) and palindrome(0,((len(s)-1)//2)-1) and palindrome(((len(s)+3)//2)-1, len(s)-1)

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

Submission status: Accepted

Solution code:
S = input()

n = len(S)

if not(S == S[::-1]):
  print("No")
  exit()
if not(S[0:((n-1)//2)] == S[((n-1)//2)-1::-1]):
  print("No")
  exit()

if not(S[((n+3)//2)-1:] == S[-1:((n+3)//2)-2:-1]):
  print("No")
  exit()
  
  
print("Yes")

Submission status: Accepted

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

a = (N-1)//2

def isKaibun(S):
    N = len(S)
    flag = 0
    for i in range((N//2)+1):
        if S[i] != S[N-1-i]:
            flag =1
    if flag == 1:
        return False
    else:
         return True

if isKaibun(S[0:a]) == True:
    if isKaibun(S[-1:-a-1:-1]) == True:
        if isKaibun(S) == True:
            print("Yes")
            exit()
print("No")

Submission status: Accepted

Solution code:
#from scipy.special import comb
#from math import factorial
 
S = input()
S1 = S[:int((len(S)-1)/2)]
S2 = S[int((len(S)+1)/2):]

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

Submission status: Accepted

Solution code:
import sys
S = input()
N = len(S)
M = int((N-1)/2)
L = int((N+3)/2)
for i in range(M):
    if(S[i] != S[-i-1]):
        print('No')
        sys.exit()
for j in range(1,M,1):
    if(S[j] != S[M-1-j]):
        print('No')
        sys.exit()
for k in range(L,N,1):
    if(S[k-1] != S[-1-(k-L)]):
        print('No')
        sys.exit()
print('Yes')

Submission status: Accepted

Solution code:
#n,m=list(map(int,input().split()))
s = list(input())
h = len(s)//2

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

Submission status: Accepted

Solution code:
def is_kaibun(s1):
    kaibun = True
    for a,b in zip(s1, s1[::-1]):
        if a != b:
            kaibun = False
    return kaibun

if __name__ == "__main__":
    s = input()
    n = len(s)

    hantei = "Yes"
    mae = s[0:int((n-1)/2)]
    ushiro = s[int((n+3)/2)-1:]
    if not is_kaibun(mae):
        hantei = "No"
    if not is_kaibun(ushiro):
        hantei = "No"
    if not is_kaibun(s):
        hantei = "No"
    print(hantei)

Submission status: Accepted

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

S = input()
is_strong_palindrome = True

if not is_palindrome(S):
    is_strong_palindrome = False

if not is_palindrome(S[:(len(S) - 1) // 2]):
    is_strong_palindrome = False

if not is_palindrome(S[(len(S) + 3) // 2 - 1:]):
    is_strong_palindrome = False

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

Submission status: Accepted

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


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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import math
import itertools
import statistics
#n, m = list(map(int, input().split()))
s = input()

#print(len(s))

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

s2 = ""
for i in range((len(s)-1)//2):
    s2 += s[i]

s3 = ""
for i in range((len(s)+1)//2, len(s)):
    s3 += s[i]
    

#print(s2)
#print(s3)

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


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


print("Yes")

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
strong = True
s1, s2 = s[0:int((n-1)/2)], s[int((n+3)/2):-1]
for i in range(0, (n-1)//2):
    if s[i] != s[-i-1]:
        strong = False
        break

for i in range(0, len(s1)//2):
    if s1[i] != s1[-i-1]:
        strong = False
        break

for i in range(0, len(s2)//2):
    if s2[i] != s2[-i-1]:
        strong = False
        break

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

Submission status: Accepted

Solution code:
s = input()

n = len(s)

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

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

if strong:
    for i in range(n):
        l = ((n+3)//2-1)+i
        r = n-1-i
        if l < r:
            if s[l] != s[r]:
                strong = False
                break
        else:
            break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
judge = True
for i in range((len(S)-1)//2):
  if not(S[i] == S[len(S)-1-i] == S[(len(S)-1)//2-1-i] == S[(len(S)-1)//2+1+i]):
    judge = False
    break
if judge:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def ispalindrome(str): return 1 if str == str[::-1] else 0
S = input()
N = len(S)
S_2 = S[0:(N-1)//2]
S_3 = S[(N+3)//2-1:]
jdg = 0

jdg += ispalindrome(S)
jdg += ispalindrome(S_2)
jdg += ispalindrome(S_3)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from bisect import *
from collections import *
from itertools import *
import functools
import sys
import math
from decimal import *
from copy import *
from heapq import *
from fractions import *
getcontext().prec = 30
MAX = sys.maxsize
MAXN = 50010
MOD = 10**9+7
spf = [i for i in range(MAXN)]
spf[0]=spf[1] = -1
def sieve():
    for i in range(2,MAXN,2):
        spf[i] = 2
    for i in range(3,int(MAXN**0.5)+1):
        if spf[i]==i:
            for j in range(i*i,MAXN,i):
                if spf[j]==j:
                    spf[j]=i
def fib(n,m):
    if n == 0:
        return [0, 1]
    else:
        a, b = fib(n // 2)
        c = ((a%m) * ((b%m) * 2 - (a%m)))%m
        d = ((a%m) * (a%m))%m + ((b)%m * (b)%m)%m
        if n % 2 == 0:
            return [c, d]
        else:
            return [d, c + d]

def charIN(x= ' '):
    return(sys.stdin.readline().strip().split(x))

def arrIN(x = ' '):
    return list(map(int,sys.stdin.readline().strip().split(x)))

def ncr(n,r):
    num=den=1
    for i in range(r):
        num = (num*(n-i))%MOD
        den = (den*(i+1))%MOD

    return (num*(pow(den,MOD-2,MOD)))%MOD

def flush():
    return sys.stdout.flush()

'''*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*'''

def chk(s):
    return s==s[::-1]
s = input()
n = len(s)
x = s[:(n-1)//2]
y = s[(n+3)//2-1:]

if chk(s) and chk(y) and chk(x):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

for i in range (a//2):
  if s[i]!=s[a-1-i]:
    print ('No')
    exit()
    
for j in range (b//2):
  if s[i]!=s[b-1-i]:
    print('No')
    exit()
    
for k in range (c-1,a//2):
  if s[i]!=s[c-1-i]:
    print('No')
    exit()
    
print('Yes')

Submission status: Accepted

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

fs = S[:(N-1)//2]
bs = S[(N+3)//2-1:]

if S == S[::-1] and \
    fs == fs[::-1] and \
    bs == bs[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:

S=input()
N=len(S)

flag=True
for idx in range(0,int((N-1)/2),1):
    if(S[idx]==S[-(idx)-1]):
        pass
    else:
        flag=False
        break

j=0
for idx in range(int((N+3)/2)-1,N,1):
    if(S[idx]==S[j]):
        pass
    else:
        flag=False
        break
    j+=1

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

Submission status: Accepted

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

S = input()
l = len(S)

    
if checkReversed(S) and checkReversed(S[:l//2]) and checkReversed(S[(l+3//2):]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import itertools,sys,collections,math,random,fractions,bisect;sys.setrecursionlimit(10**7)
sr = sys.stdin.readline; P = print; P2 = lambda x: print(*x, sep="\n")
def I(i=0): t = [int(x)-i for x in sr().split()];return t
def S(): t = sr().split(); return t if len(t) > 1 else t[0]
L1,L2,L3,L4, = [],[],[],[]

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

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 159: B (2020/03/22)
S = str(input())
N = len(S)
x1 = int((N-1)/2)
flag = True
for i in range(x1):
    if S[i] != S[N-1-i]:
        flag = False
        break
if flag == True:
    y1 = int((x1+1)/2)
    for j in range(y1):
        if S[j] != S[x1-1-j]:
            flag = False
if flag == False:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
def is_pa(s):
    s = s.casefold()
    rev = reversed(s)
    return list(s)==list(rev)
S = input()
N = len(S)
if is_pa(S) and is_pa(S[0:int((N-1)/2)]) and is_pa(S[int((N+3)/2)-1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
l, r, flg = 0, N-1, 1
while l < r:
    if S[l] != S[r]:
        flg = 0
        break
    l += 1
    r -= 1
if flg == 0:
    print("No")
    exit()
l, r = 0, (N-1)//2-1
while l < r:
    if S[l] != S[r]:
        flg = 0
        break
    l += 1
    r -= 1
if flg == 0:
    print("No")
    exit()
l, r = (N+3)//2-1, N-1
while l < r:
    if S[l] != S[r]:
        flg = 0
        break
    l += 1
    r -= 1
if flg == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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


S = input()
idx = len(S) // 2
if check_kaibun(S) and check_kaibun(S[:idx]) and check_kaibun(S[idx + 1 :]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
S = input()
s0 = S[:len(S)//2]
s1 = S[len(S)//2+1:]
def f(s):
    n = len(s)
    halfn = n//2
    result = True
    for i in range(halfn):
        if s[i] != s[-(i+1)]:
            result = False
    return result
ans = 'Yes'
if not f(S):
    ans = 'No'
elif not f(s0):
    ans = 'No'
elif not f(s1):
    ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = str(input())
N = len(S)
def is_palindrom(s):
  return s == s[::-1]

i = int((N - 1) / 2)
j = int((N + 3) / 2 - 1)
if is_palindrom(S) and is_palindrom(S[0:i]) and is_palindrom(S[j:N]):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
s_r = s[::-1]
res = []
for i in range((int(len(s) - 1) // 2)):
    if s[i] != s_r[i]:
        print("No")
        exit()
    res.append(s[i])

res = "".join(res)
res_r = res[::-1]
for i in range(len(res)):
    if res[i] != res_r[i]:
        print("No")
        exit()

print("Yes")

Submission status: Accepted

Solution code:
import sys

s = input()
n = len(s)

if s == s[::-1]:
    m = s[0: int((n-1)/2)] 
    if m == m[::-1]:
        l = s[int((n+3)/2): n-1]
        if l == l[::-1]:
            print("Yes")
            sys.exit()

print("No")

Submission status: Accepted

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

flag = 0
if s == s[::-1]:
  flag += 1
ss = s[0:l//2]
if ss == ss[::-1]:
  flag += 1
  
if flag == 2:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def ispalindrome(str): return 1 if str == str[::-1] else 0
a = input()
l = len(a)
left = a[0:(l-1)//2]
right = a[(l-1)//2+1:]
if ispalindrome(left) and ispalindrome(right) and ispalindrome(a):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()

def is_kaibun(s_):
  s_len = len(s_)
  for i in range(int(s_len / 2)):
    if s_[i] != s_[s_len - i - 1]:
      return False
  else:
    return True
    
c_2 = s[:int((len(s) - 1) /2)]
c_3 = s[int((len(s) + 3) / 2)-1:]

result_1 = is_kaibun(s)
result_2 = is_kaibun(c_2)
result_3 = is_kaibun(c_3)

if result_1 and result_2 and result_3:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())
n = len(s)
ps1 = s[:int((n-1)/2)]
ps2 = s[int((n+3)/2)-1:]

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

Submission status: Accepted

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


s = input()
n = len(s)

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

ans = 'Yes' if (a == b == c) else 'No'
print(ans)

Submission status: Accepted

Solution code:
S = input()
ans = False
if S == S[::-1]:
    s1 = S[:(len(S) - 1) // 2]
    if s1 == s1[::-1]:
        s2 = S[(len(S) + 3) // 2 - 1:]
        if s2 == s2[::-1]:
            ans = True
print("Yes" if ans else "No")

Submission status: Accepted

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

def strong(s):
  N=len(s)
  tail = (N-1)//2
  s0=s[0:tail]
  head = (N+3)//2
  s1=s[head-1:]
  # print('s0={} s1={}'.format(s0,s1))
  return kalin(s0) and kalin(s1) and kalin(s)  

if strong(input()):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

else:
    print("No")

Submission status: Accepted

Solution code:
S=input()

ans = "No"

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


print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ispalindrome(str): return 1 if str == str[::-1] else 0

S = input()
le = len(S)
one = ispalindrome(S)
two = ispalindrome(S[:(le-1)//2])
three = ispalindrome(S[(le+3)//2-1:])
if one and two and three:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
ans = "Yes"
for i in range(N):
    j = N - i - 1
    if not S[i] == S[j]:
        ans = "No"
for i in range((N-1)//2):
    j = (N-1)//2 - i - 1
    if not S[i] == S[j]:
        ans = "No"
for i in range((N+3)//2 - 1, N):
    j = N - i - 1
    if not S[i] == S[j]:
        ans = "No"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import copy
S = list(input())
N = len(S)
s0 = copy.deepcopy(S)
S.reverse()
s1 = S[:(N-1)//2]
s2 = S[(N+3)//2-1:]
s3 = S[:(N-1)//2]
s4 = S[(N+3)//2-1:]
s3.reverse()
s4.reverse()

if S == s0 and s1 == s3 and s2 == s4:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
S = list(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())

x = 0
nag = len(s)
y = (nag-1) //2

for i in range(y):
    if s[i] != s[nag - 1 -i]:
        x = 1
        break
    
for j in range(y//2):
    if x == 1:
        break
    if s[j] != s[y - 1 - j]:
        x = 1
        break

for k in range(y//2):
    if x == 1:
        break
    if s[y + 1 + k] != s[nag - 1 - k]:
        x = 1
        break

if x == 0:
    print("Yes")
elif x == 1:
    print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def is_p(s):
    n = len(s)
    a, b = s, s[::-1]
    if a==b:
        return True
    return False

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


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

    return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
ans = True
for i in range(len(s) // 2):
    if s[len(s) - 1 - i] != s[i]:
        ans = False
if ans:
    for i in range(len(s) // 4):
        if s[(len(s) - 1) // 2 - i - 1] != s[i]:
            ans = False

    for i in range(len(s) // 2 + 1, len(s) // 4 + len(s) // 2 + 1):
        if s[i] != s[len(s) - 1 - i]:
            ans = False

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

Submission status: Accepted

Solution code:
def check(st):
  flag = True
  n = len(st)
  for i in range(int(n/2)):
    if st[i] != st[n-1-i]:
      flag = False
  return flag
 
s=input()
n=len(s)
one = s[0:int((n-1)/2)]
two = s[int(((n+3)/2)) - 1:n]
 
if check(one) and check(two) and check(s):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
#-------------------------------------------------------------------
import sys
def p(*_a):
  _s=" ".join(map(str,_a))
  #print(_s)
  sys.stderr.write(_s+"\n")
#-------------------------------------------------------------------

s = input()		# 文字列の入力  abcdefg...
n = len(s)

def isKB(s):
	
	b = False
	for i in range((len(s)+1)//2):
		
		#p(i, s[i], " _ ",-i-1, s[-i-1])
		
		if s[i]!=s[-i-1]: break
		
	else:
		b = True

	return b


#p(s, s[:((n-1)//2)], "((n+3)//2)-1=",((n+3)//2)-1, s[((n+3)//2)-1:n])

ans="No"

if isKB(s):
	if isKB(s[:((n-1)//2)]):
		if isKB(s[((n+3)//2)-1:n]):
			ans="Yes"

print(ans)

Submission status: Accepted

Solution code:
import sys,math
sys.setrecursionlimit(10**9)
from collections import defaultdict
 
IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())
 
s=input()

def check(s):
    j=len(s)-1
    i=0
    while i<j:
        
        if s[i]!=s[j]:
            return 0
        i+=1
        j-=1
    return 1
sum=0
sum=sum+1
if len(s)%2==0:
    print("No")
else:
    if check(s)==0:
        print("No")
    else:
        n=len(s)
        s1=[s[i] for i in range(0,n//2)]
        s2=[s[i] for i in range(n//2+1,n)]
        if check(s1)==1:
            print("Yes")
        else:
            print("No")

Submission status: Accepted

Solution code:
s=input('')
r=[]
t=[]
for a in range(len(s)):
    r.append(s[a])
    t.append(s[a])

t.reverse()
ok=1
for a in range(len(r)):
    if t[a]==r[a]:
        ok=ok*1
    else:
        ok=ok*0


f=[]
g=[]
for a in range(int((len(r)-1)/2)):
    f.append(s[a])
    g.append(s[a])
g.reverse()

for a in range(len(f)):
    if f[a]==g[a]:
        ok=ok*1
    else:
        ok=ok*0

h=[]
i=[]
p=int((len(r)-1)/2)
for a in range(int((len(r)-1)/2)):
    h.append(s[a+p+1])
    i.append(s[a+p+1])
i.reverse()

for a in range(p):
    if h[a]==g[a]:
        ok=ok*1
    else:
        ok=ok*0

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

Submission status: Accepted

Solution code:
word = input()


def check(word):
  flg = True
  n = len(word)
  for i in range(int(n/2)):
    if word[i] != word[n-i-1]:
      flg = False
      break
  
  return flg

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

Submission status: Accepted

Solution code:
s = str(input())

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

n = len(s)
sub1 = s[0:(n - 1)//2]
sub2 = s[(n + 3)//2 - 1:n + 1]

if is_kaibun(s) and is_kaibun(sub1) and is_kaibun(sub2):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = list(input())

flag = False

reverseS = list(reversed(S))
N = len(S)
firstN = (N - 1) // 2
laterN = (N + 3) // 2 - 1
first = S[0:firstN]
later = S[laterN: N + 1]
reverseFirst = list(reversed(first))
reverseLater = list(reversed(later))

if S == reverseS and reverseFirst == first and reverseLater == later:
    flag = True
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

MOD = 10**9
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

S = list(input())

R = []

for s in reversed(S):
    R.append(s)

ans = True

N = len(S)
h = N//2
ni = (N-1)//2
h2 = ni//2
S2 = S[0:ni]

san = (N+3)//2 - 1
h3 = san//2
S3 = S[san:]

if S[0:h] != R[0:h]:
    print('No')
    exit()


R2 = []
for s in reversed(S2):
    R2.append(s)


if S2 != R2:
    print('No')
    exit()

R3 = []
for s in reversed(S3):
    R3.append(s)


if S3 != R3:
    print('No')
    exit()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

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

aaa = "".join(S)
tmp = int((N-1)/2-1)
bbb = "".join(S[0:tmp+1])
tmp = int((N+3)/2-1)
ccc = "".join(S[tmp:N])

sum = palindrome(aaa)+palindrome(bbb)+palindrome(ccc)


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