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 = str(input())
N = len(S)
 
head = round((N-1)/2)
end = round((N+3)/2-1)

headS = S[:head]
endS = S[end:]

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

Submission status: Accepted

Solution code:
# Author: cr4zjh0bp
# Created: Sun Mar 22 11:54:41 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

s = ns()
n = len(s)
flag = True
if s != ''.join(list(reversed(s))):
    flag = False
for i in range((n - 1) // 2):
    p = (n - 1) // 2
    if s[i] != s[p - i - 1]:
        flag = False

for i in range((n + 3) // 2 - 1, n):
    p = n
    if s[i] != s[p - i - 1]:
        flag = False

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

Submission status: Accepted

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

ans = True


def rec(i, j):
    if(i >= j):
        return True
    if(S[i] != S[j]):
        return False
    return ans & rec(i+1, j-1)


ans1 = rec(0, N-1)
ans2 = rec(0, int((N-1)/2)-1)
ans3 = rec(int((N+3)/2)-1, N-1)
if(ans1 & ans2 & ans3):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

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

S = input()

if not check_palindrome(S):
    print('No')
else:
    if not check_palindrome(S[:int(len(S) / 2)]):
        print('No')
    else:
        if not check_palindrome(S[int(len(S) / 1) + 2:]):
            print('No')
        else:
            print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def istrue(s):
	for a, b in zip(s, reversed(s)):
		if a != b:
			return False
	return True


s = input()
fl = (len(s)-1)/2
el = (len(s)+3)/2-1
f = s[0:int(fl)]
e = s[int(el):len(s)]

if istrue(s) is False:
	print("No")
	exit()
if istrue(f) is False:
	print("No")
	exit()
if istrue(e) is False:
	print("No")
	exit()
print("Yes")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from sys import stdin
from operator import itemgetter
# stdin = open("sample.txt")

s = stdin.readline().rstrip()
t = s[0:(len(s)-1)//2]
u = s[(len(s)+3)//2 - 1:len(s)]

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

Submission status: Accepted

Solution code:
s = input()

n = len(s)

k = s[:(n-1)//2]
r = s[(n+1)//2:]

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

Submission status: Accepted

Solution code:
s = input()

def judge(s):
    l = int((len(s)-1)/2)
    if len(s)%2 == 1:
        if s[:l] == s[l+1:][::-1]:
            return True
        else:
            return False
    else:
        if s[:l+1] == s[l+1:][::-1]:
            return True
        else:
            return False

def main(s):
    l = int((len(s)-1)/2)
    frag1 = judge(s)
    frag2 = judge(s[:l])
    frag3 = judge(s[l+1:])
    if frag1 and frag2 and frag3:
        return 'Yes'
    else:
        return 'No'
      
print(main(s))

Submission status: Accepted

Solution code:
def palind(LIST, N):
    for i in range(N):
        if LIST[i] != LIST[-1-i]:
            return False
    return True

S = list(input())
n = len(S)
front = S[:((len(S)+1)//2-1)]
flag = palind(S, len(S)) and palind(front, len(front))

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

Submission status: Accepted

Solution code:
def palind(LIST, N):
    for i in range(N):
        if LIST[i] != LIST[-1-i]:
            return False
    return True

S = list(input())
n = len(S)
flag = palind(S, n)

front = S[:((n+1)//2-1)]
rear = S[((n+3)//2-1):]
n = len(front)
flag = flag and palind(front, n) and palind(rear, n)

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

Submission status: Accepted

Solution code:
def isPalin(s):
    s3=s[::-1]
    if(s3==s):
        return 1
    return 0
s=input()
n=len(s)
n1=(n-1)//2
n2=(n+3)//2
s1=s[0:n1]
s2=s[n2-1:]
if(isPalin(s) and isPalin(s1) and isPalin(s2)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

s = input()
length = len(s)
if check_palindrome(s) and check_palindrome(s[0:length//2]) and check_palindrome(s[length//2+1:length]):
    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]
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)
isKaibun = True
for i in range(n//2):
    if(S[i] != S[n-i-1] or S[i] != S[n//2-i-1] or S[n//2+i+1] != S[n//2-i-1]):
        isKaibun = False
        break
if(isKaibun):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
ans = True
N = len(S)
twice = (N - 1) // 2
triple = (N + 3) // 2
cnt=0
for i in range(N):
    if S[i] != S[-(i+1)]:
       ans = False
for j in range(twice):
    if S[j] != S[twice - j-1]:
        ans = False
for k in range(triple,N - triple + 1):
    if S[k] != S[N - cnt]:
        ans = False
    cnt += 1
if ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = list(input().rstrip())
l = int((len(S) -1)/2)
print('Yes') if S[:l] == S[-l:] else print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = True
N = len(S)
twice = (N - 1) // 2
triple = (N + 3) // 2
cnt=0
for i in range(N):
    if S[i] != S[-(i+1)]:
       ans = False
for j in range(twice):
    if S[j] != S[twice - j-1]:
        ans = False
for k in range(triple,N - triple + 1):
    if S[k] != S[N - cnt]:
        ans = False
    cnt += 1
if ans:
    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:] else "No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def iskaibun(s):
    if(s==""):
        return 1
    else:
        if(s[0]==s[-1]):
            return iskaibun(s[1:-1])
        else:
            return 0


st = input()
l = len(st)
q = (l-1)//2
st1 = st[0:q]
st2 = st[q+1:]
if(iskaibun(st1)==1 and iskaibun(st2)==1 and iskaibun(st)==1):
        print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

def iskaibun2(s):
    for i in range(len(s)-1):
        if(s[i]==s[-1-i]):
            continue
        else:
            return 0
            break
    return 1

st = input()
l = len(st)
q = (l-1)//2
st1 = st[0:q]
st2 = st[q+1:]
if(iskaibun2(st1)==1 and iskaibun2(st2)==1 and iskaibun2(st)==1):
        print("Yes")
else:
    print("No")

Submission status: Accepted

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

ans = True
if S != S[::-1]:
    ans = False

st = S[:(N-1)//2]
en = S[(N+3)//2-1:]

if st != st[::-1] or en != en[::-1]:
    ans = False

# print(st, en)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if ok(s[:n//2]) and ok(s[n//2+1:]) and ok(s):print('Yes')
else:print('No')

Submission status: Accepted

Solution code:
st=input()
def iskaibun(s):
  if(s==""):
      return 1;
  else:
      if(s[0]==s[-1]):
          return iskaibun(s[1:-1])
      else:
          return 0

l = len(st)
q = (l-1)//2
st1 = st[0:q]
st2 = st[q+1:]

if(st1 == st2[::-1] and iskaibun(st1)==1 and iskaibun(st2)==1):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 入力
s = input()
n = len(s)

l = (n - 1) // 2
r = (n + 3) // 2

if s == s[::-1] and s[0:l] == s[0:l][::-1] and s[r-1:n] == s[r-1:n][::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

left = s[:len(s)//2]
right = s[len(s)//2+1:]

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


if kaibun(left)==True and kaibun(right)==True and kaibun(s)==True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    N = len(S)
    a = S[0:int((N-1)/2)]
    b = S[int((N+3)/2)-1:N]
    print(YES) if S == S[::-1] and a == a[::-1] and b == b[::-1] else print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#coding:utf-8
s = input()
n = len(s)

m = (n-1)//2
k = (n+3)//2

#検査する文字列と、それをそのまま反転したものを比較し一致すれば回文
if s == s[::-1] and s[:m] == s[:m][::-1] and s[k-1:] == s[k-1:][::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
S_mae = S[:int((N-1)/2)]
S_usi = S[int((N+1)/2):]

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

s = ns()
n = len(s)
t = s[:n//2]
u = s[n//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()
if len(s) % 2 == 0:
	print('No')
else:
	n=(len(s)-1)//2
	if s[:n] == s[n+1:]:
		print('Yes')
	else:
		print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
def check(s):
    flag = True
    for i in range(len(s)//2):
        # print(s[i], s[-i-1])
        if s[i] != s[-i-1]:
            flag = False
    return flag
S = input()
if len(S) == 3:
    if S[0] != S[-1]:
        print("No")
    else:
        print("Yes")
    exit()
flag = True
if not check(S):
    flag = False
# print(check(S))
# if len(S) % 2 == 1:
#     cnt += 1
# if S[:len(S)//2] != S[len(S)//2 + cnt:]:
#     flag = False
# print(S[:len(S)//2], S[len(S)//2+1:])
s = S[:len(S)//2]
# print(check(s))
if not check(s):
    flag = False
# print(s)
# if s[:len(s)//2] != s[len(s)//2 + cnt:]:
#     flag = False
s = S[(len(S)+3)//2-1:]
# print(check(s))
# print(s)
if not check(s):
    flag = False
# print(s)
# if s[:len(s)//2] != s[len(s)//2 + cnt:]:
#     flag = False
# print(s[:len(s)//2], s[len(s)//2-cnt:])
print("Yes" if flag else "No")

Submission status: Accepted

Solution code:
S = input()


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


N = len(S)

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

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

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

print('Yes')

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
if len(s) / 2 == 0:
    print("No")
    exit()

def check(i):
    if len(i) % 2 != 0:
        i2 = i[len(i) // 2 + 1:len(i)]
    else:
        i2 = i[len(i) // 2:len(i)]
    if i[0:len(i) // 2] == i2[::-1] or len(i) == 1:
        return(True)
    return(False)

s2 = s[0:(len(s) - 1) // 2]
s3 = s[(len(s) - 1) // 2 + 1:len(s)]

if check(s) == True and check(s2) == True and check(s3) == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

def circ_check(s):
    s_rev=s[::-1]
    n=len(s)
    if n%2==1:
        half_n=int((n-1)/2)
    else:
        half_n=int(n/2)
    if s_rev[0:half_n] ==s[0:half_n]:
        s_check=1
    else:
        s_check=0
    return(s_check) 


res1=circ_check(s)
res2=circ_check(s[0:int((n-1)/2)])
res3=circ_check(s[int((n-1)/2+1):len(s)])
if res1*res2*res3==1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
S_mae = S[:int((N-1)/2)]
S_usi = S[int((N+1)/2):]

if (S_mae[:len(S_mae)] == S_mae[::-1]) and (S_usi[:len(S_usi)] == S_usi[::-1]) and (S == S[::-1]):
    print("Yes")
else:
    print("No")
    
#print(S_mae)
#print(S_usi)

Submission status: Accepted

Solution code:
def is_kaibun(mojiretsu):
    half_point = len(mojiretsu)//2
    zenhan = mojiretsu[:half_point]
    if len(mojiretsu) % 2 == 1:
        kouhan = mojiretsu[half_point+1:]
    else:
        kouhan = mojiretsu[half_point:]

    if zenhan == kouhan[::-1]:
        return 'Yes'
    else:
        return 'No'


def strong_kaibun(mojiretsu):

    joken_1 = is_kaibun(mojiretsu)
    joken_2 = is_kaibun(mojiretsu[:((len(mojiretsu)-1)//2)])
    joken_3 = is_kaibun(mojiretsu[((len(mojiretsu)+3)//2)-1:])

    if joken_1 == 'Yes' and joken_2 == 'Yes' and joken_3 == 'Yes':
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    mojiretsu = input()
    print(strong_kaibun(mojiretsu))

Submission status: Accepted

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

Submission status: Accepted

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

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

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] or s1 != s1[::-1] or s2 != s2[::-1]:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

    num1 = int((N - 1) / 2)
    num2 = int((N + 3) / 2)

    if S[: num1] == S[num2 - 1 :]:
        print('{}'.format('Yes'))
    else:
        print('{}'.format('No'))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
N = len(S)
subS1 = S[0: (N - 1) // 2]
subS2 = S[(N + 3) // 2 - 1:N]

# print(subS1, subS2)
# print(S[::-1], subS1[::-1], subS2[::-1])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
kaibunn = []

S = input().split()

for kaibunn in S:
  l = int((len(kaibunn)-1)/2)
  if kaibunn[:l] == kaibunn[-l:]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
input_line = input()

strnum = len(input_line)
hulfnum = int(strnum/2)
upper = input_line[0:hulfnum]
lower = input_line[-hulfnum:]

if upper == lower:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

def check(s):
  if(s==s[::-1]):
    return True
  else:
    return False
  
n = len(s)
if(check(s[:(n-1)//2])):
  if(check(s[((n+3)//2)-1:])):
    if(check(s)):
    	print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
     print('No')

Submission status: Accepted

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

if(kaibun(S,N) & kaibun(S[0:(N+1)//2-1],N//2) & kaibun(S[N:(N+3)//2-2:-1],N//2)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
flag = True
for i in range((len(s)-1)//2):
    if s[i] != s[len(s)-i-1]:
        flag = False
        break
if not flag:
    print('No')
    exit()
else:
    flag1 = True
    flag2 = True
    t = ''
    u = ''
    for i in range((len(s)-1)//2):
        t += s[i]
    for i in range((len(s)-1)//2+1,len(s)):
        u += s[i]
    if len(t)%2 != 0:
        for i in range((len(t)-1)//2):
            if t[i] != t[len(t)-i-1]:
                flag1 = False
                break
    else:
        for i in range(len(t)//2):
            if t[i] != t[len(t)-i-1]:
                flag1 = False
                break
    if len(u)%2 != 0:
        for i in range((len(u)-1)//2):
            if u[i] != u[len(u)-i-1]:
                flag2 = False
                break
    else:
        for i in range(len(u)//2):
            if u[i] != u[len(u)-i-1]:
                flag2 = False
                break
    if flag1 == True and flag2 == True:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
S = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin,setrecursionlimit
s = stdin.readline().rstrip()
if s != s[::-1]:
    print("No")
    exit()
mae = s[:len(s)//2]
ushiro = s[(len(s)+1)//2:]
if mae != mae[::-1]:
    print("No")
    exit()
if ushiro != ushiro[::-1]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gaus(n):
    if n//1<n:
        return int(n+1)
    return int(n)
def hante(S):
    n=len(S)
    for i in range(n//2):
        if S[i]!=S[n-i-1]:
            return False
    return True
S=input()
S1=S[:len(S)//2]
S2=S[gaus(len(S)/2):]

if hante(S)==True and hante(S1)==True and hante(S2)==True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    def check(s):
        return s == s[::-1]
    s = input()
    n = len(s)
    if check(s) and (s[:(n-1)>>1]) and check(s[((n+3)>>1)-1:]):
        print("Yes")
    else:
        print("No")
    return

#Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
s=input();h=len(s)//2;print(' YNeos'[s[:h]==s[h-1::-1]==s[-h:]::2])

Submission status: Accepted

Solution code:
S = input()
N = len(S)
n_1 = (N - 1) // 2
n_2 = (N + 3) // 2

s_1 = S[:n_1]
s_2 = S[n_2 - 1:]

ans = "Yes"

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

for i in range(len(s_1)):
    if s_1[i] != s_1[-i - 1]:
        ans = "No"

for i in range(len(s_2)):
    if s_2[i] != s_2[-i - 1]:
        ans = "No"

print(ans)

Submission status: Accepted

Solution code:
S=input()
l=len(S)
num=int((l-1)/2)

x=True

for i in range(l):
    if not S[i]==S[(l-1-i)]:
        x=False
        break
        
for i in range(num):
    if not S[i]==S[(num-i-1)]:
        x=False
        break
   

for i in range(num+1,l):
    if not S[i]==S[(l+num-i)]:
        x=False
        break
        
if x==True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
front=[]
back=[]
ans="Yes"
for i in range((len(s)-1)//2):
  front.append(s[i])
for i in range((len(s)+3)//2-1,len(s)):
  back.append(s[i])
back.reverse()
if front!=back:
  ans="No"

fro=[]
bac=[]
if len(front)%2!=0 and len(front)!=1:
  for i in range((len(front)-1)//2):
    fro.append(front[i])
  for i in range((len(front)+3)//2-1,len(front)):
    bac.append(front[i])
  bac.reverse()
  if fro!=bac:
    ans="No"
elif len(front)%2==0:
  for i in range(len(front)//2):
    fro.append(front[i])
  for i in range(len(front)//2,len(front)):
    bac.append(front[i])
  bac.reverse()
  if fro!=bac:
    ans="No"

print(ans)

Submission status: Accepted

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

ans = 0
if n % 2 == 0:
    ans = 'No'
elif s != ''.join(list(reversed(s))):
    ans = 'No'
elif s[:int((n-1)/2)] != ''.join(list(reversed(s[:int((n-1)/2)]))):
    ans = 'No'
elif s[int((n+3)/2-1):] != ''.join(list(reversed(s[int((n+3)/2-1):]))):
    ans = 'No'
else:
    ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
sel='B'
#A
if sel=='A':
    N,M=map(int,input().split())
    ans=0
    ans+=M*(M-1)//2
    ans+=N*(N-1)//2
    print(ans)

#B
if sel=='B':
    def ispal(s):
        for i in range(len(s)//2+1):
            if s[i]!=s[-(i+1)]:
                return False
        return True

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

#C
if sel=='C':
    L=int(input())
    print((L**3)/27)

#D
if sel=='D':    
    N=int(input())
    A=[int(i) for i in input().split()]
    kin=list(set(A))
    cnt={}
    for k in kin:
        cnt[k]=0
    for a in A:
        cnt[a]+=1
    SUM=0
    for k in kin:
        SUM+=cnt[k]*(cnt[k]-1)//2
    for a in A:
        if cnt[a]>=2:
            print(SUM-cnt[a]+1)
        else:
            print(SUM)
        
#E
if sel=='E':
    a=0

#F
if sel=='F':
    N,S=map(int,input().split())
    A=[int(i) for i in input().split()]

    for l in range(N):
        for r in range(l,N):
            print(tab[l][r])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()


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


N = len(S)

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

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

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

print('Yes')

Submission status: Accepted

Solution code:

s  = input()
a = s[:int(len(s)/2)]
b = s[:-int(len(s)/2 + 1)]
flag = 0
if s == s[::-1]:
    if a == a[::-1]:
        if b == b[::-1]:
            flag = 1

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
s = input()

s_norm = list(s)
s_rev = list(reversed(s))
if s_norm == s_rev:
    s_len = len(s)
    second = round((s_len -1)/2)
    s_new = s_norm[0:second]
    s_new_rev = list(reversed(s_new))
    if s_new == s_new_rev:
        third = round((s_len +3)/2)
        s_last = s_norm[third-1:s_len+1]
        s_last_rev = list(reversed(s_new))
        if s_last == s_last_rev:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding: utf-8 -*-
s = input()
n = len(s)
m = (n-1) // 2
k = (n+3) // 2
flag = 1
for i in range(0, n//2):
    if s[i] != s[n-i-1]:
        flag = 0
        break
for i in range(0, m//2):
    if s[i] != s[m-i-1]:
        flag = 0
        break
for i in range(0, (n-k)//2+1):
    if s[i+k-1] != s[n-i-1]:
        flag = 0
        break
if flag == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

tmp1, tmp2 = [], []
flag = 0
for i in range(int((N-1)/2)):
  tmp1.append(S[i])
for i in range(int((N+3)/2)-1,N):
  tmp2.append(S[i])
#print(tmp1, tmp2)
if tmp1 == tmp2:
  flag = 1
  
if flag == 1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

S = input().strip()

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

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

Submission status: Accepted

Solution code:
s = input()
cnt = len(s)//2
ans = "Yes"

for i in range(cnt):
    if s[i] != s[-(i+1)]:
        ans = "No"
        break

    if s[i] != s[i + cnt + 1]:
        ans = "No"
        break
        
print(ans)

Submission status: Accepted

Solution code:
import sys
s = input()
n = len(s)
t = s
t = t[::-1]
if s!=t:
    print("No")
    exit()
t = s[:(n-1)//2]
t = t[::-1]
if s[:(n-1)//2]!=t:
    print("No")
    exit()
t = s[(n+3)//2-1:]
t = t[::-1]
if s[(n+3)//2-1:]!=t:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

kaibunn = []

S = input().split()

for kaibunn in S:
  l = int((len(kaibunn)-1)/2)
  
  if kaibunn[:l] == kaibunn[-l:]:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

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