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

Solution (Python):



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


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

Solution (Python):
s = input()
s2 = s[::-1]


if s != s2:
    print('No')
    exit(0)

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

partial_s2 = partial_s[::-1]
if partial_s != partial_s2:
    print('No')
    exit(0)

partial_ss = s[((len(s) + 3) // 2) - 1:]

partial_ss2 = partial_s[::-1]
if partial_ss != partial_ss2:
    print('No')
    exit(0)
print('Yes')

Solution (Python):



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


def check2(s):
    l = len(s) // 2
    if len(s) % 2 == 0:
        if s[:l] != s[:l-1:-1]:
            return False
    else:
        if s[:l] != s[:l:-1]:
            return False
    return True


def check(s):
    l = len(s) // 2
    if s[:l] != s[:l:-1]:
        return False
    if check2(s[:l]) and check2(s[l+1:]):
        return  True
    return False


def main():
    s = input()
    if check(s):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Solution (Python):
s=input()
n=len(s)
ans='Yes'
for i in range((n-1)//2):
  if not(s[i]==s[(n-3)//2-i]==s[i+(n+1)//2]==s[n-i-1]):
    ans='No'
print(ans)

Solution (Python):
s=input()

def func(ass):
    for i in range(len(ass)//2):
        if ass[i] != ass[-(i+1)]:
            print('No')
            exit()

func(s)
func(s[:len(s)//2])
func(s[len(s)//2+len(s)%2:])

print('Yes')

Solution (Python):
S = input()

N = len(S)

def check(SS):
    L = len(SS)
    f = 0
    for i in range(L):
        if SS[i] != SS[L - i - 1]:
            f = 1
    if f == 1:
        return False
    else:
        return True


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

Solution (Python):



import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S = i2s()
    N = len(S)
    if is_kaibun(S) and is_kaibun(S[:(N-1)//2]) and is_kaibun(S[(N+3)//2-1:]):
        print('Yes')
    else:
        print('No')
    return

def is_kaibun(S):
    return S == ''.join(reversed(S))

main()

Solution (Python):

s = input()

rev_s = s[::-1]
half_s = s[0:len(s)//2]
rev_half_s = half_s[::-1]
third_s = s[(len(s)+3)//2-1:]
rev_third_s = third_s[::-1]

if (s == rev_s) and (half_s == rev_half_s) and (third_s == rev_third_s):
  print('Yes')
else:
  print('No')

Solution (Python):
s = [s for s in input()]
l = len(s)//2

s_1 = s[:l]
s_2 = s[l+1:]

if s!=s[::-1]:
  print('No')
elif s_1!=s_1[::-1]:
  print('No')
elif s_2!=s_2[::-1]:
  print('No')
else:
  print('Yes')

Solution (Python):
import sys

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

s = input()
n = len(s)

if not hantei(s):
  print('No')
  sys.exit(0)
    
if not hantei(s[0:(n-1)//2]):
  print('No')
  sys.exit(0)
  
if not hantei(s[(n+1)//2 : n]):
  print('No')
  sys.exit(0)

print('Yes')

Solution (Python):
s = input()

s_len = len(s)
s_1 = s[:(s_len-1)//2]
s_2 = s[(s_len+3)//2-1:]
test_1 = s
test_2 = s[::-1]

is_ok = True

if not test_1==test_2:
    is_ok = False

if not s_1==s_1[::-1]:
    is_ok = False

if not s_2==s_2[::-1]:
    is_ok = False

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

Solution (Python):
s = list(input())


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


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


s_end = s[len(s)//2+1::]
for k in range(len(s_end)//2):
    if s_end[k] != s_end[-k-1]:
        print('No')
        exit()

print('Yes')

Solution (Python):
S = str(input())
N = len(S)

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

if pre == post:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
l = len(s)

f = 'Yes'
for i in range(int((l-1)/2)):
    if s[i] != s[l-i-1]:
        f = 'No'
for i in range(int(((l-1)/2)//2)):
    if s[i] != s[l-i-int((l-1)/2+1)-1]:
        f = 'No'




print(f)

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

Solution (Python):
S=list(input())
left=S[0:(len(S)-1)//2]
right=S[(len(S)-1)//2+1:]

def is_kaibun(string):
    if string==string[::-1]:
        return True
    else:
        return False



def yes():
    print("Yes")
    exit()
def No():
    print("No")
    exit()
if not left ==right:
    No()
else:
    if is_kaibun(left):
        yes()
    else:
        No()

Solution (Python):
s = input()
l = len(s)

def check_kaibun(s):
    if s == s[::-1]:
        return 1
    else:
        return -1

if check_kaibun(s) == -1:
    print('No')
    exit(0)

mae = s[0: int(l/2)]
ushiro = s[int(l/2)+1:]

if mae == ushiro:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
l = len(s)
if list(s)[:(l-1)//2] == list(s)[(l+1)//2:] == list(s)[:(l-1)//2:-1]:
	print("Yes")
else: print("No")

Solution (Python):
def solve(s):
    n = len(s)
    if n==1:
        return True
    if n==2:
        return s[0]==s[1]
    if n==3:
        return s[0]==s[2]
    if n%2==0:
        s1 = s[:n//2]
        s2 = s[n//2:]
        return s1==s2[::-1]
    else:
        s1 = s[:(n-1)//2]
        s2 = s[(n+1)//2:]
        return s1==s2[::-1]

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

Solution (Python):
s = input()
n = len(s)
s_back = s[::-1]
s_2 = s[:(n-1)//2]
s_2back = s_2[::-1]
s_3 = s[(n+2)//2:]
s_3back = s_3[::-1]

if s == s_back and s_2 == s_2back and s_3 == s_3back:
    print("Yes")
else:
    print("No")

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

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

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

Solution (Python):
s = str(input())
n = len(s)

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

s_for = s[:(n-1) // 2]
s_back = s[(n+3) // 2 - 1:]

if ispalindrome(s) and ispalindrome(s_for) and ispalindrome(s_back):
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))

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

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

if __name__ == '__main__':
    main()

Solution (Python):
ans = "Yes"
s = input()
n = len(s)
half = n//2
def iskaibun(v):
    vh = len(v)//2
    for i in range(vh):
        if v[i] != v[-i-1]:
            return True
    return False

if iskaibun(s) or iskaibun(s[0:half]) or iskaibun(s[-half:]):
    ans = 'No'
print(ans)

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

s1 = s[:n // 2]
s2 = s[n // 2 + 1:]

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

Solution (Python):
S=input()
N=len(S)
zen=(N-1)//2
kou=(N+3)//2
T=S[::-1]

T2=S[:zen]
T2=T2[::-1]

T3=S[kou-1:]
T3=T3[::-1]



if T==S:
    if S[:zen]==T2:
        if S[kou-1:]==T3:
            print("Yes")
            exit()
print("No")

Solution (Python):
s = input()

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

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

def kaibun(s, n):
    if n % 2 == 1:
        front = s[:n//2+1]
        back = s[n//2:]
    else:
        front = s[:n//2]
        back = s[n//2:]

    return front == "".join(reversed(back))


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

Solution (Python):

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)

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



def f():
    return 1

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)

Solution (Python):
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')

Solution (Python):
import sys

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

def check(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")

Solution (Python):
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()

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) 

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




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

Solution (Python):
import sys
def is_pal(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')

Solution (Python):
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')

Solution (Python):
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):
    
    if S[(N+3)//2+i-1] != S[-1 - i]:
        print("No")
        exit()
print("Yes")

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):



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()

Solution (Python):
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')

Solution (Python):
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()

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):

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()

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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):

    ans ="No"
if not is_kaibun(s[0:(len(s)-1)//2]):

    ans ="No"
if not is_kaibun(s[(len(s)+3)//2-1:]):

    ans ="No"
print(ans)

Solution (Python):

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

Solution (Python):
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])

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

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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')

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

Solution (Python):
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)

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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))






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')

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):



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

Solution (Python):
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")

Solution (Python):
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")

Solution (Python):
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)

Solution (Python):
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")

Solution (Python):


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

Solution (Python):




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

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

tmp = s[0:int(((n-1)/2))]

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


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

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

print("Yes")

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
import sys
import math
import collections
from collections import deque


s = input()

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

Solution (Python):
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")

Solution (Python):
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"

Solution (Python):
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)