Problem:


Score : 200 points

Problem Statement

A string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:

S is a palindrome.

Let N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.

The string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.

Determine whether S is a strong palindrome.

Constraints

S consists of lowercase English letters.

The length of S is an odd number between 3 and 99 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

If S is a strong palindrome, print Yes;
otherwise, print No.

Sample Input 1

akasaka

Sample Output 1

Yes

S is akasaka.

The string formed by the 1-st through the 3-rd characters is aka.

The string formed by the 5-th through the 7-th characters is aka.
All of these are palindromes, so S is a strong palindrome.

Sample Input 2

level

Sample Output 2

No

Sample Input 3

atcoder

Sample Output 3

No



Sample input:
akasaka


Sample output:
Yes

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    s = str(input())
    n = len(s)
    len1 = int((n-1)/2)
    s1 = s[:len1]
    len2 = int((n+1)/2)
    s2 = s[len2:]
    if (s == s[::-1]) & (s1 == s1[::-1]) & (s2 == s2[::-1]):
            print('Yes')
    else:
        print('No')
        
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 160 B

s = input()
pd = False

if s[::-1] == s:
    n1 = (len(s) - 1) // 2
    s1 = s[:n1]
    if s1 == s1[::-1]:
        n2 = (len(s) + 3) // 2
        s2 = s[n2-1:]
        if s2 == s2[::-1]:
            pd = True

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
def main():
    s = input()
    lens = len(s)
    mae_end = (lens - 1) // 2
    mae = s[:mae_end]
    if mae != mae[::-1]:
        print('No')
        sys.exit()
    ushiro_start = (lens+3) // 2 - 1
    ushiro = s[ushiro_start:]
    if mae != ushiro[::-1]:
        print('No')
        sys.exit()
    print('Yes')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

s_top = s[0:(n-1)//2]
s_bottom = s[(n+3)//2-1:]
if s_top == s_top[::-1] and s_bottom == s_bottom[::-1] and s == s[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

for i in range(((N-1)//2)//2):
    if S[i] != S[(N-1)//2-1-i]:
        ans = 'No'
        break
    if S[(N-1)//2+1+i] != S[N-1-i]:
        ans = 'No'
        break
            
print(ans)

Submission status: Accepted

Solution code:
s=input()
n=len(s)
sa=s[:(n-1)//2]
sb=s[(n+1)//2:]
sar=""
sbr=""
for i in range(len(sa)):
    sar+=sa[len(sa)-i-1]
    sbr+=sb[len(sa)-i-1]
if sar==sa and sbr==sb and sa==sb:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
#inport
import sys

#input
S = str(sys.stdin.readline())
N = len(S)
S = S[0:N-1]
N = len(S)
S_1 = S[0:int((N-1)/2)]
S_2 = S[int((N+3)/2-1):N]
#print(S)
#print(S[::-1])
#print(S_1)
#print(S_1[::-1])
#print(S_2)
#print(S_2[::-1])

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

Submission status: Accepted

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

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

left = S[:N//2]
right = S[(N+2)//2:]
if isPalindrome(S) and (left == right):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import numpy as np
def cumsum(x):
    return list(np.cumsum(x))

def cumsum_number(N,K,x):
    ans=[0]*(N-K+1)
    number_cumsum = cumsum(x)
    number_cumsum.insert(0,0)
    for i in range(N-K+1):
        ans[i]=number_cumsum[i+K]-number_cumsum[i]
    return ans
"""
int #整数
float #小数

#for
for name in fruits: #fruitの頭から操作
    print(name)

#リスト
list0 = [] #リスト生成
list0 = [1,2,3,4] #初期化
list0 = [0]*10 #[0,0,0,0,0,0,0,0,0,0]
list1= [i for i in range(10)] #>>> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
list1 = list(map(int, input().split()))　# 複数の入力をリストに入れる
number=[int(input()) for i in range(int(input()))] #複数行の入力をリストに
list1 = list1 + [6, 7, 8] #リストの追加
list2.append(34) #リストの追加　最後に（）内が足される
list.insert(3,10) #リストの追加　任意の位置（追加したい位置,追加したい値）
len(list4) #リストの要素数
max(sa) #list saの最小値
list5.count(2) #リスト(文字列も可）内の2の数
list1.sort() #並び替え小さい順
list1.sort(reverse=True)  #並び替え大きい順
set(list1) #list1内の重複している要素を削除し、小さい順に並べる
sum([2,3,   ,3]) #リストの合計

abs(a) #aの絶対値
max(a,b) min(a,b) #最大値　最小値
text1 = text1.replace("34","test") #text1内の"34"を"test"に書き換える(文字列内の文字を入れ替える)

exit(0) #強制終了

cumsum(リスト) #累積和をリストで返す
cumsum_number(N,K,x) #N個の数が含まれるリストx内のK個からなる部分和をリストで返す
"""
S=list(input())
SS=S[0:(len(S)-1)//2]
SSS=S[(len(S)+3)//2:-1]
Sreverse=S[::-1]
if S==S[::-1] and SS==SS[::-1] and SSS==SSS[::-1]:
        print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
l = len(s)//2
s_ = s[::-1]
s1 = s[:l]
s1_ = s1[::-1]
s2 = s[l+1:]
s2_ = s2[::-1]

if s == s_ and s1 == s1_ and s2 == s2_:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
l = len(s)//2
s_ = s[::-1]
s1 = s[:l]
s1_ = s1[::-1]
s2 = s[l+1:]
s2_ = s2[::-1]

if s == s_ and s1 == s1_ and s2 == s2_:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# B - String Palindrome
S = input()
T = S[::-1]
c = len(S)//2
ans = 'No'
if S==T and S[:c]==T[c+1:] and S[c+1:]==T[:c]:
    ans = 'Yes'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if s != s[::-1]:
    print('No')
    exit()

s1 = s[:(n - 1) // 2]
if s1 != s1[::-1]:
    print('No')
    exit()

s2 = s[(n + 3) // 2 - 1:]
if s2 != s2[::-1]:
    print('aaa')
    print('No')
    exit()

print('Yes')

Submission status: Accepted

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

for i in range(n):
    if s[i] != s[n - i - 1]:
        print('No')
        break
else:
    last = (n - 1) // 2
    for i in range(last):
        if s[i] != s[last - i - 1]:
            print('No')
            break
    else:
        start = ((n + 3) // 2) - 1
        for i in range(start, n):
            if s[i] != s[last + start - i - 1]:
                print('No')
                break
        else:
            print('Yes')

Submission status: Accepted

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

Srev = ""
for i in range(1, N + 1):
  Srev += S[-1*i]
if S == Srev:
  cnt += 1
  
S1 = S[0:(N - 1)//2]
S1rev = ""
for i in range(1, len(S1) + 1):
  S1rev += S1[-1*i]
if S1 == S1rev:
  cnt += 1
  
S2 = S[(N + 3)//2 - 1:N + 1]
S2rev =""
for i in range(1, len(S2) + 1):
  S2rev += S2[-1*i]
if S2 == S2rev:
  cnt += 1

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

Submission status: Accepted

Solution code:
def kaibun(s):
  l=len(s)
  if(l%2==0):
    for i in range(l//2):
      if(s[i]!=s[l-1-i]):
        return 0
    return 1
  else:
    for i in range((l-1)//2):
      if(s[i]!=s[l-1-i]):
        return 0
    return 1

s=input()
l=len(s)
if(l%2==0):
  print("No")
else:
  if(kaibun(s[:((l-1)//2)])*kaibun(s)):
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
def isKaibun(S):
    if S != S[::-1]:
        return False
    return True

def main(S):
    if isKaibun(S)==False:
        return "No"
    N=len(S)
    S_1 = S[0:int((N-1)/2)]
    if isKaibun(S_1)==False:
        return "No"
    S_2 = S[int((N+3)/2)-1:N]
    if isKaibun(S_2)==False:
        return "No"
    return "Yes"

print(main(S))

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
s_rev = s[::-1]
#print(s_rev)
center = (len(s)+1)//2
s_firsthalf = s[0:center-1]
#print(s_firsthalf)
s_firsthalf_rev = s_firsthalf[::-1]
if s == s_rev and s_firsthalf == s_firsthalf_rev:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()
a=len(S)
b=S[:int((a-1)//2)]
c=b[::-1]
d=S[int((a+3)//2)-1:]
e=d[::-1]
f=S[::-1]
if b==c and d==e and S==f:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    S = input()
    n = len(S)

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


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
s = input()
mid = len(s)//2
flag = 1
for i in range(len(s)//2+1):
    if s[mid-i] == s[mid+i]:
        continue
    else:
        flag = 0

t = s[:(len(s)-1)//2]

for i in range(len(t)):
    if t[i] == t[~i]:
        continue
    else:
        flag = 0

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

for i in range(len(t)):
    if t[i] == t[~i]:
        continue
    else:
        flag = 0

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

Submission status: Accepted

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

if func(s[0:(n-1)//2]) and func(s[(n+3)//2-1:]) and func(s):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
a = s[::-1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions
from operator import itemgetter
import itertools
import copy


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
#from fractions import gcd
#from itertools import combinations # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
s = input()
ln = len(s)
if s == s[::-1]:
    front = s[:(ln-1)//2]
    back = s[(ln+3)//2-1:]
    #print(front,back)
    if front == front[::-1] and back == back[::-1]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import *

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

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

Submission status: Accepted

Solution code:
x = input()
if len(x) % 2 == 0 :
  adjust = 0
else:
  adjust = 1
xa = x[0:(len(x)-adjust)//2]
xb = x[(len(x)+3)//2-1:]
xar = ''.join(list(reversed(xa)))
xbr = ''.join(list(reversed(xb)))
#print(xa,xb,xar,xbr)
if xa == xb and xar == xbr:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = str(input())
N = len(s)
kai = 0
for i in range(int((N+1)/2)-1):
    if s[i] == s[int(i+(N+1)/2)] and kai == 0:
        kai = 0
    else:
        kai = 1

if kai == 0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
def f(a,b):
  X = s[a-1:b]
  Y = X[-1::-1]
  if X == Y:
    return(1)
  else:
    return(0)
  
if f(1,n) * f(1,(n-1)//2) * f((n+3)//2,n) == 1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
N = (len(S)-1)//2
M = (len(S)+3)//2
count = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math as mt
#import numpy as np

def ro(n):
  return mt.floor(mt.sqrt(n))
def ya():
  print("Yes")
  return
def na():
  print("No")
  return


#a,b=map(int,input().split())
#lis=list(map(int,input().split()))
#n=int(input())
s=input()

n=(len(s)+1)//2
if s[:n-1]!=s[n:] or s!=s[::-1]:
  na()
else:
  ya()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#[0]*n
s = input()
r = s[::-1]
ans = "Yes"

if s==r:
    for i in range(int(len(s)/2)):
        if s[i] != s[int(len(s)/2)+i+1]:
            ans = "No"
else:
    ans = "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
def palin_check(str):
    rstr = str[::-1]
    slen = len(str) if len(str) % 2 == 0 else len(str)-1
    if str[:int(slen/2)] != rstr[:int(slen/2)]:
        return "No"
    else:
        return "Yes"

if palin_check(S) == "No":
    print("No")
else:
    if palin_check(S[:int((len(S)-1)/2)]) ==  'No':
        print("No")
    else:
        print("Yes")

Submission status: Accepted

Solution code:
S = input()

flag = 1
N = len(S)+1

if S != S[::-1]:
    flag = 0

Stemp = S[0:int(N/2-1)]

if S[0:int(N/2-1)] != Stemp[::-1]:
    flag = 0

Stemp = S[int((N+2)/2-1):]
if S[int((N+2)/2-1):] != Stemp[::-1]:
    flag = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

sa = s[:(n - 1) // 2]
sb = s[(n + 1) // 2:]

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

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
s_1 = s[0:int((n-1)/2)]
s_2 = s[int((n+3)/2-1):n]

if s == list(reversed(s)) and s_1 == list(reversed(s_1)) and s_2 == list(reversed(s_2)):
  print("Yes")

else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
L = S[:len(S)//2]
R = S[(len(S)+1)//2:]

L1 = L[:len(L)//2]
L2 = L[(len(L)+1)//2:]
R1 = R[:len(R)//2]
R2 = R[(len(R)+1)//2:]

if (L1==L2[::-1]) and (R1==R2[::-1]) and (L==R[::-1]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
B = int((len(S) - 1) / 2)
A = S[:B]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
flag = 0
for i in range(len(s)//2):
    if s[i] != s[len(s)-1-i]:
        flag = 1
for i in range((len(s)-1)//2//2):
     if s[i] != s[(len(s)-1)//2-1-i]:
        flag = 1
j = 0
for i in range((len(s)+3)//2-1,len(s)):
    if s[i] != s[len(s)-1-j]:
        flag = 1
    j += 1
if flag == 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = input()
a = n[:len(n)//2]
b = n[len(n)//2+1:]
if n == n[::-1]:
    if a == a[::-1]:
        if b == b[::-1]:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
import sys

s = input()

def check(str):
    l = 0
    r = len(str) - 1
    while l < r :
        if str[l] != str[r]:
            return False
        l += 1
        r -= 1
    return True

if check(s):
    l = 0
    r = (len(s) - 1) // 2
    if check(s[l:r]):
        l = (len(s) + 3) // 2 - 1
        if check(s[l:len(s)]):
            print("Yes")
            sys.exit()
print("No")

Submission status: Accepted

Solution code:
s = list(input()) 
l = len(s) # l = 29
j = l - 1 # j = 28

for i in range(l // 2):
    if s[i] != s[j]:
        print('No')
        exit(0)
    j -= 1


h = (l + 3) // 2 - 1 # h = 15
j = h - 2

for h in range(l // 2):
    if s[h] != s[j]:
        print('No')
        exit(0)
    j -= 1

print('Yes')

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 check_palindrome(target):
    reverse_t = target[::-1]
    if reverse_t == target:
        return True
    else:
        return False


s = input()
n = len(s)

if not check_palindrome(s):
    print('No')
    exit()

if not check_palindrome(s[:int((n-1)/2)]):
    print('No')
    exit()

if not check_palindrome(s[int((n+3)/2) - 1:]):
    print('No')
    exit()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(X):
  if all(X[i] == X[(-1)*(i+1)] for i in range(len(X))) == True:
    return 1
  else:
    return 0

s = list(input())
n = len(s)
A = s[0:int((n-1)/2)]
B = s[int((n+3)/2)-1:n]
if f(s) * f(A)*f(B) == 1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def solve():
    S = input()
    N = len(S)
    print('YNeos'[S[:int((N-1)/2)] != S[int((N+1)/2):]::2])


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

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

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

t = s[(n+2)//2:]
m = len(t)
for i in range(m//2):
   if t[i] != t[m-1-i]:
      ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
s=list(input())
left=s[:(len(s)-1)//2]
right=s[(len(s)+1)//2:]

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

if not check(left):
  print('No')
elif not check(right):
  print('No')
elif not check(s):
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

S = input()
N = len(S)

a = S[0:(N-1)//2]
b = S[N - (N-1)//2::]

if a == b: print("Yes")
else: print("No")

Submission status: Accepted

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

ans='Yes'

for i in range((N-1)//2):
  if S[i]!=S[N-1-i]:
    ans='No'
    break

for i in range((N-1)//4):
  if S[i]!=S[(N-1)//2-1-i]:
    ans='No'
    break

print(ans)

Submission status: Accepted

Solution code:
s = input()
n = len(s)
 
a = s == s[::-1]
s1 = s[:(n-1)//2]
b = s1 == s1[::-1]
s2 = s[(n+3)//2 - 1:]
c = s2 == s2[::-1]
 
print(['No', 'Yes'][a and b and c])

Submission status: Accepted

Solution code:
import sys
S = list(input())
if S == list(reversed(S)):
    if S[:int((len(S)-1)/2)] == list(reversed(S[:int((len(S)-1)/2)])):
        if S[int((len(S)-1)/2)+1:] == list(reversed(S[int((len(S)-1)/2)+1:])):     
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

Solution code:
S = input()
N = len(S)
S1 = S[0:int((N-1)/2)]
S2 = S[int((N+1)/2):]


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
S_len=len(S)
flag_1=True
flag_2=True
flag_3=True

for i in range(S_len):
  if S[i]!=S[S_len-1-i]:
    flag_1=False
for i in range(int((S_len-1)/2)):
  if S[i]!=S[int((S_len-1)/2)-1-i]:
    flag_2=False
for i in range(int((S_len-1)/2)):
  if S[int((S_len+3)/2)-1+i]!=S[S_len-1-i]:
    flag_3=False
flag=flag_1*flag_2*flag_3
if flag==True:
  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] and S[(int((N+3)/2)-1):] == S[(int((N+3)/2)-1):][::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
ss = s[:len(s) // 2]

ans = "Yes"
if s != s[::-1] or ss != ss[::-1]: ans = "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input()
l = len(x)


if x == x[::-1]:
    pre_x = x[:int((l-1)/2)]
    ato_x = x[int((l+1)/2):]
    if pre_x == ato_x:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()
RS=S[::-1]

mae=S[0:(len(S)-1)//2]
Rmae=mae[::-1]


usiro=S[(len(S)+1)//2:len(S)]
Rusiro=usiro[::-1]


if S==RS and mae==Rmae and usiro ==Rusiro:
    print("Yes")
else:
    print("No")

#print(mae,usiro)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
s = input()

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9


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

def main():
    S = input()

    n = len(S)//2
    is_palindrome1 = check_palindrome(S)
    is_palindrome2 = check_palindrome(S[:n])
    is_palindrome3 = check_palindrome(S[n+1:])
    if is_palindrome1 and is_palindrome2 and is_palindrome3:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

X = list(S)
N = len(S)
N2 = int((N - 1) / 2)
N3 = int(((N + 3) / 2) - 1)

X1 = X[0 : N2]
X2 = X[N3 : N]

X10 = list(reversed(X1))
X20 = list(reversed(X2))

if X1 == X10 and X2 == X20 and X1 == X2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def actual(s):
    is_palindrome = lambda x: x == x[::-1]

    N = len(s)

    idx1 = int((N - 1) / 2)
    s1 = s[:idx1]

    idx2 = int((N + 3) / 2) - 1
    s2 = s[idx2:]

    if is_palindrome(s) and is_palindrome(s1) and is_palindrome(s2):
        return 'Yes'

    return 'No'

s = input()
print(actual(s))

Submission status: Accepted

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

def kai(l,r):
    ss=s[l:r+1]
    nn=len(ss)
    #print(ss)
    if nn==1:
        return 'Yes'
    else:
        for i in range(int((nn-1)/2)):
            if ss[i]==ss[nn-i-1]:
                if i==int((nn-1)/2)-1:
                    return 'Yes'
            else:
                return 'No'
                break

if kai(0,n-1)=='Yes':
    if kai(0,int((n-1)/2)-1)=='Yes':
        if kai(int((n+3)/2)-1,n-1)=='Yes':
           print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

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


def kaibun(s):
    if list(s) == list(reversed(s)):
        return True
    else:
        return False


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

    flag = True
    flag &= kaibun(S)

    s2 = S[0:(N - 1) // 2]
    flag &= kaibun(s2)

    s3 = S[(N + 3) // 2 - 1:N]
    flag &= kaibun(s3)

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


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
s=input()
n=len(s)
# print(s[:int((n-1)/2)])
# print(s[int((n+3)/2):])
a=s[:(n-1)//2]
b=s[(n+3)//2-1:]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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