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:
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import fractions
import random
from heapq import heappop,heappush
import time
import os
import sys
import datetime
from functools import lru_cache
readline=readline = sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s


#@lru_cache(maxsize=None)  
def f():
    return 1
#main
s=input()
ans=True
n=len(s)
if(not s==s[::-1]):ans=False
if(not s[:n//2]==s[:n//2][::-1]):ans=False
if(not s[(n+3)//2-1:]==s[(n+3)//2-1:][::-1]):ans=False

Yn(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys

S = sys.stdin.readline().strip()
N = len(S)

def check(s):
    # print(s)
    len_s = len(s)
    i, j = 0, len_s - 1
    while i <= j:
        if s[i] != s[j]:
            return False
        i += 1
        j -= 1
    return True

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    S = input()

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


main()

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

S = str(input())

N = len(S)
ans = 1

def check(strs):
    n = len(strs)
    for i in range(n // 2 + 1):
        if strs[i] == strs[-1-i]:
            pass
        else:
            return False
    
    return True

# print(S[:(N - 1) // 2])
# print(S[(N + 3) //2-1 :])

S_b = S[:(N -1) //2]
S_a = S[(N + 3) // 2 - 1:]

if check(S) and check(S_b) and check(S_a):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
def is_pal(s):
    #print(s,'s')
    i,j=0,len(s)-1
    while i<=j:
        if s[i]==s[j]:
            i+=1
            j-=1
        else:
            return False
    return True
s=sys.stdin.readline()[:-1]
n=len(s)
if n%2!=0:
    if is_pal(s[:n//2]) and is_pal(s[n//2+1:]) and is_pal(s):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
s=input()
rs=s[::-1]
h=len(s)//2
s2=s[:h]
rs2=s2[::-1]
t=(len(s)+3)//2
s3=s[t-1:]
rs3=s3[::-1]
if s==rs and s2==rs2 and s3==rs3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

for i in range((N - 1) // 4):
    if S[i] != S[(N-1)//2-i-1]:
        print("No")
        exit()

for i in range((N - 1) // 4):
    # print(S[(N+3)//2+i-1])
    if S[(N+3)//2+i-1] != S[-1 - i]:
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
def isp(s):
    if s==s[::-1]:
        return(True)
    else:
        return(False)
s=input()
n=len(s)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# -*- coding:utf-8 -*-

def main():
  s = input().strip()
  n = len(s)
  def is_palindrome(s):
    n = len(s)
    for i in range(len(s)):
      if s[i] != s[n-(i+1)]:
        return False
    return True
  
  if is_palindrome(s) and is_palindrome(s[:(n-1)//2]) and is_palindrome(s[(n+3)//2-1:]):
    print('Yes')
  else:
    print('No')

if __name__=='__main__':
  main()

Submission status: Accepted

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


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


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

if palindrome(s) + palindrome(a) + palindrome(b) == 3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

  N=len(S)
  s=S
  for i in range(len(s)//2):
    if s[i]!=s[len(s)-i-1]:
      print('No')
      return
  s=S[:(N-1)//2]
  for i in range(len(s)//2):
    if s[i]!=s[len(s)-i-1]:
      print('No')
      return
  s=S[(N+3)//2-1:]
  for i in range(len(s)//2):
    if s[i]!=s[len(s)-i-1]:
      print('No')
      return
  print('Yes')
  
main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8
import sys,os
from collections import defaultdict, deque
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    S = input()
    N = len(S)
    def isP(S):
        return S == S[::-1]
    YN(isP(S) and isP(S[:(N-1)//2]) and isP(S[((N+3)//2-1):]))
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import copy
s=list(input())

def is_kaibun(ls):
    tmp = ls[:]
    tmp.reverse()
    return "".join(ls) == "".join(tmp)

flag = True
if not is_kaibun(s):
    flag = False
aaa=s[0:(len(s)-1)//2]
if not is_kaibun(aaa):
    flag=False
bbb=s[(len(s)+3)//2-1:len(s)]
if not is_kaibun(bbb):
    flag=False

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

Submission status: Accepted

Solution code:
def check(s, f, t):
    while (f < t):
        if s[f] != s[t]:
            return False
        f += 1
        t -= 1
    return True

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

Submission status: Accepted

Solution code:
def is_kaibun(s):
    for i,c in enumerate(s):
        if c != s[len(s)-i-1]:
            return False
        if i > len(s)//2:
            break
    return True


s = input()
ans = "Yes"
if not is_kaibun(s):
#    print("S is not kaibun")
    ans ="No"
if not is_kaibun(s[0:(len(s)-1)//2]):
#    print("S-1 is not kaibun")
    ans ="No"
if not is_kaibun(s[(len(s)+3)//2-1:]):
#    print("S+3 is not kaibun")
    ans ="No"
print(ans)

Submission status: Accepted

Solution code:

def palindrome(sz):
    N = len(sz)
    sL = sz[:int((N-1)/2)]
    sR = sz[int(N+1)/2:]
    palin = (list(sL) == list(reversed(sR)))
    palinL = (list(sL) == list(reversed(sL)))
    palinR = (list(sR) == list(reversed(sR)))
    return (palin and palinL and palinR)

S = raw_input().rstrip("\r\n")
if palindrome(S):
    print("Yes\n")
else:
    print("No\n")

Submission status: Accepted

Solution code:
import copy
s=list(input())
t=copy.deepcopy(s)
s=s[::-1]
a=[]
for i in range((len(s)-1)//2):
 a.append(t[i])
b=[]
for i in range(len(s)-(len(s)+2)//2):
 b.append(t[i])
#print(a,b,s,t)
if s!=t:
 print('No')
 #print(s,t)
else:
 if a!=a[::-1]:
  print('No')
  #print(a,a[::-1])
 else:
  if b!=b[::-1]:
   print('No')
   #print(b,b[::-1])
  else:
   print('Yes')

Submission status: Accepted

Solution code:
s = input()
sr = s[::-1]
mannnaka = (len(s) - 1) // 2

for i in range(mannnaka):
    if s[i] != sr[i]:
        print('No')
        exit()

for i in range(mannnaka // 2):
    if s[i] != s[mannnaka - i - 1] or sr[i] != sr[mannnaka - i - 1]:
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
S = input()

a = S[:(len(S) - 1) // 2]
b = S[(len(S) - 1) // 2 + 1:]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
S = input()
def is_palindrome(S):
  P = S[::-1]
  if S == P:
    return True
  return False
if is_palindrome(S):
  N = len(S)
  if is_palindrome(S[0:(N-1)//2]) and is_palindrome(S[(N+3)//2-1:N]):
    print('Yes')
    sys.exit(0)
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 = list(input())
N = len(S)
ans = "Yes"
s = []
for i in range(N-1, -1, -1):
    s.append(S[i])
A = []
B = []
for i in range((N-1)//2):
    A.append(S[i])
for i in range((N+3)//2-1, N):
    B.append(S[i])
a = []
b = []
for i in range(len(A)-1, -1, -1):
    a.append(A[i])
    b.append(B[i])
if A != a or B != b or s != S:
    ans = "No"
print(ans)

Submission status: Accepted

Solution code:
def judge(word):
    l = len(word)
    for i in range(l//2):
        if word[i] != word[l-1-i]:
            return 0
            break
    else:
        return 1
        
word = input()
n = len(word)
j1 = judge(word)
j2 = judge(word[:(n-1)//2])
j3 = judge(word[(n+3)//2 - 1:])

if j1 == j2 == j3 == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

def check_kaibun(st):
  if st == st[::-1]:
    pass
  else:
    print('No')
    exit()

check_kaibun(s)
check_kaibun(s[:int((len(s)-1)/2)])
check_kaibun(s[int((len(s)+3)/2-1):])
print('Yes')

Submission status: Accepted

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


def is_palindrome(string):
    return True if string == string[::-1] else 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:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from bisect import bisect_right, bisect_left
import random
from itertools import permutations, accumulate, combinations, product
from re import split
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gamma, log
from operator import mul
from functools import reduce
from copy import deepcopy
import re

sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
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)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 10 ** 9 + 7


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

Submission status: Accepted

Solution code:
def check(s):  
    baccha = ''.join(reversed(s)) 
    if (s == baccha): 
        return True
    return False
s=input()
n=len(s)
s1=s[0:n//2]
s2=s[n//2+1:]
if check(s) and check(s1) and check(s2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()


def palindrome(s1: str) -> bool:
    n = len(s1)
    for i in range(n // 2):
        if s1[i] != s1[-(i + 1)]:
            return False
    return True


half = len(s) // 2
if palindrome(s):
    if palindrome(s[:half]):
        if palindrome(s[half + 1:]):
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
s = str(input())

t = list(s)
t_ = list(reversed(t))

n = len(s)
p = list(s[0:(n-1)//2])
q = list(s[(n+3)//2-1:n])

p_ = list(reversed(p))
q_ = list(reversed(q))

#print(p)
#print(p_)
#print(q)
#print(q_)

for i in range(n):
    if t[i] != t_[i]:
        print('No')
        exit()

for i in range(len(p)):
    if p[i] != p_[i]:
        print('No')
        exit()

for i in range(len(q)):
    if q[i] != q_[i]:
        print('No')
        exit()
else:
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

S1 = S[::-1]
S21 = S[:(N - 1) // 2]
S22 = S21[::-1]
S31 = S[(N + 3) // 2 - 1:]
S32 = S31[::-1]

if S == S1 and S21 == S22 and S31 == S32:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
import math
import string
import fractions
import random
from operator import itemgetter
import itertools
from collections import deque
import copy
import heapq
from bisect import bisect, bisect_left, bisect_right

MOD = 10 ** 9 + 7
INF = float('inf')
input = lambda: sys.stdin.readline().strip()

sys.setrecursionlimit(10 ** 8)

SS = list(input())
S = copy.deepcopy(SS)
N = len(S)
S_ = [S[i] for i in range(len(S) - 1, -1, -1)]
if S_ != S:
    print("No")
    sys.exit()
S1 = [S[i] for i in range(0, (N - 1) // 2)]
S = S1
S_ = [S[i] for i in range(len(S) - 1, -1, -1)]
if S != S_:
    print("No")
    sys.exit()
S2 = [SS[i] for i in range((N + 3) // 2 - 1, N)]
SS = S2
S_ = [SS[i] for i in range(len(SS) - 1, -1, -1)]
if S != S_:
    print("No")
    sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
s = input()

for i in range(len(s)):
    if s[i] != s[len(s)-i-1]:
        print('No')
        exit()

pos2 = (len(s)-1)//2

for i in range(pos2):
    if s[i] != s[pos2-i-1]:
        print('No')
        exit()

pos3 = (len(s)+3)//2

for i in range(len(s)-pos3):
    if s[pos3-1+i] != s[len(s)-i-1]:
        print('No')
        exit()
        
print('Yes')

Submission status: Accepted

Solution code:
S = input()
len_s = len(S)
_1 = S[:(len_s-1)//2]
_2 = S[(len_s+2)//2:]

S_rev = ''.join(list(reversed(S)))
_1_rev = ''.join(list(reversed(_1)))
_2_rev = ''.join(list(reversed(_2)))


if S == S_rev:
  if _1_rev == _1:
    if _2_rev == _2:
      print('Yes')
      exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a  = [s.split() for s in open(0)][0][0]
if len(a) % 2 != 0:
    a_half = a[:int((len(a) - 1)/2)]
    a_q = a[int((len(a) + 3) / 2) - 1:len(a) + 1]
    
    if a == a[::-1] and a_half == a_half[::-1] and a_q == a_q[::-1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

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

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

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

print(result)

Submission status: Accepted

Solution code:
S = [c for c in input().strip()]

if S != list(reversed(S)):
    print("No")
else:
    x = (len(S) - 1) // 2
    s1 = S[:x]
    s2 = S[x+1:]
    if s1 != list(reversed(s1)):
        print("No")
    elif s2 != list(reversed(s2)):
        print("No")
    else:
        print("Yes")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
S=list(input())
N=len(S)
T=S[:int((N-1)/2)]

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


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

Submission status: Accepted

Solution code:
#n = int(input())
#a,b = map(int,input().split())
#a_L = list(map(int,input().split()))

s = list(input())
n = len(s)

if s != list(reversed(s)):
    print("No")
    exit()

tmp = s[0:int(((n-1)/2))]
#print(tmp)
if tmp != list(reversed(tmp)):
    print("No")
    exit()


tmp = s[int(((n+3)/2))-1:]
#print(tmp)
if tmp != list(reversed(tmp)):
    print("No")
    exit()

print("Yes")

Submission status: Accepted

Solution code:
ss = input()
l = len(ss)
aa = ss[:(l-1)//2]
bb = ss[(l+3)//2-1:]
def palindrome(string): return 1 if string==string[::-1] else 0

a = ''.join(map(str,aa))
b=''.join(map(str,bb))
s = ''.join(map(str,ss))

if palindrome(a)==1 and palindrome(b)==1 and palindrome(s)==1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()

n = len(s)
count = 0

before = int((n-1)/2)
after = int((n+1)/2)

if s[:before] != s[after:]:
    count += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_kaibun(s):
    return s[:len(s)//2] == s[::-1][:len(s)//2]

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

Submission status: Accepted

Solution code:
s1 = list(input())

b1 = s1 == s1[::-1]

s2 = s1[:(len(s1) + 1) // 2-1]

b1 = b1 & (s2 == s2[::-1])

s3 = s1[(len(s1) + 1) // 2:]

b1 = b1 & (s3 == s3[::-1])

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

Submission status: Accepted

Solution code:
import sys
import math
import collections
from collections import deque
#n = int(input())
#n, m = map(int, sys.stdin.readline().split())
s = input()
#x = list(map(int, sys.stdin.readline().split()))
n = len(s)
for i in range(int((n-1)/2)):
    if s[i] != s[int((n-1)/2)-1-i]:
        print("No")
        sys.exit()

for j in range(int((n-1)/2)):
    if s[int((n+3)/2)-1+j] != s[n-1-j]:
        print("No")
        sys.exit()

for k in range(n):
    if s[k] != s[n-1-k]:
        print("No")
        sys.exit()


print("Yes")

Submission status: Accepted

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

flag = True

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

Submission status: Accepted

Solution code:
def palin(s):
  n=len(s)
  if s==s[::-1]:
    return 1
  else:
    return 0
s=raw_input()
n=len(s)
if palin(s)+palin(s[0:(n-1)/2])+palin(s[(n+3)/2 -1:])==3:
  print "Yes"
else:
  print "No"

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)

import math

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)


def resolve():
    S = [x for x in sys.stdin.readline().split()][0]  # 文字列 一つ
    # N = [int(x) for x in sys.stdin.readline().split()][0]  # int 一つ
    # N, D = [int(x) for x in sys.stdin.readline().split()]  # 複数int
    # h_list = [int(x) for x in sys.stdin.readline().split()]  # 複数int

    # grid = [list(sys.stdin.readline().split()[0]) for _ in range(N)]  # 文字列grid
    # v_list = [int(sys.stdin.readline().split()[0]) for _ in range(N)]
    # grid = [[int(x) for x in sys.stdin.readline().split()]
    #         for _ in range(N)]  # int grid

    logger.debug('{}'.format([]))

    N = len(S)
    if S != S[::-1]:
        print('No')
        return

    S1 = S[:((N - 1) // 2)]
    if S1 != S1[::-1]:
        print('No')
        return

    S2 = S[(N + 3) // 2 - 1:]
    if S2 != S2[::-1]:
        print('No')
        return

    print('Yes')


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """akasaka"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """level"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """atcoder"""
        output = """No"""
        self.assertIO(input, output)

Submission status: Accepted

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

S = input().strip()
N = len(S)


s1 = S[0:(N-1)//2]
s2 = S[(N+3)//2-1:]

if is_palin(S) and is_palin(s1) and is_palin(s2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if ls == list(reversed(ls)) and ls[:(N-1)//2] == list(reversed(ls[:(N-1)//2])) and ls[(N+3)//2-1:] == list(reversed(ls[(N+3)//2-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:
import copy
s = list(input())
n = len(s)
a = copy.copy(s)
a.reverse()
ans = 'No'
if s == a and s[0:(n-1)//2] == s[(n+1)//2:]:
    ans= 'Yes'

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()

N = len(S)

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

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

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

print(ans)

Submission status: Accepted

Solution code:
def pal(s):
    n = len(s)
    if len(s)==1:
        return True
    for i in range(len(s)//2):
        if s[i]!=s[n-1-i]:
            # print(s)
            return False
            # break
    else:
        return True
s = input()
n = len(s)
# print(s[:((n-1)//2)],s[(n+1)//2:])
if pal(s) and pal(s[:((n-1)//2)]) and pal(s[(n+1)//2:]):
    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:]

for i in range(len(S)):
	if S[i]!=S[-(i+1)]:
		print("No")
		exit()
for i in range(len(A)):
	if A[i]!=A[-(i+1)]:
		print("No")
		exit()
for i in range(len(B)):
	if B[i]!=B[-(i+1)]:
		print("No")
		exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

s = input()

if len(s) % 2 == 0:
    p = len(s) // 2
    if is_palindrome(s) and is_palindrome(s[:p]) and is_palindrome(s[p:]):
        print('Yes')
    else:
        print('No')
else:
    p = len(s) // 2
    if is_palindrome(s) and is_palindrome(s[:p]) and is_palindrome(s[p + 1:]):
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
S = input()

c1 = (S==S[-1::-1])
S2 = S[0:(len(S)-1)//2]
c2 = (S2==S2[-1::-1])
S3 = S[(len(S)+3)//2-1:]
c3 = (S3 == S3[-1::-1])
if c1 and c2 and c3:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s=input()
l=len(s)
m=(l-1)//2
lst1=[]
lst2=[]
for i in range(m):
  lst1.append(s[i])
  lst2.append(s[l-i-1])
chk='T'
if lst1!=lst2:
  chk='F'
n=m//2
lst3=[]
lst4=[]
lst5=[]
lst6=[]
for i in range(n):
  lst3.append(s[i])
  lst4.append(s[m-i-1])
  lst5.append(s[m+1+i])
  lst6.append(s[l-i-1])
if lst3!=lst4:
  chk='F'
if lst5!=lst6:
  chk='F'
if chk=='T':
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()

n = len(s)
ans = "Yes"

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

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'
for i in range(n//2//2):
  if s[i]!=s[n//2-1-i] or s[n//2+1+i]!=s[n-1-i]:
    ans='No'
print(ans)

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
A = int((N-1)/2)
B = int((N+3)/2)

S_A = S[:A]
S_B = S[B-1:]

ans = 0
S_R = list(reversed(S))
if S != S_R:
    ans += 1
    
S_A_R = list(reversed(S_A))
if S_A != S_A_R:
    ans += 1
    
S_B_R = list(reversed(S_B))
if S_B != S_B_R:
    ans += 1

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