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):
import sys


def input():
    return sys.stdin.readline().strip()


S = input()
N = len(S)
flag = True
for i in range(N // 2):
    if S[i] == S[N - i - 1]:
        continue
    else:
        flag = False

if flag:
    S1 = S[: (N - 1) // 2]
    N = len(S1)
    for i in range(N // 2):
        if S1[i] == S1[N - i - 1]:
            continue
        else:
            flag = False

if flag:
    S2 = S[(len(S) + 3) // 2 - 1 :]
    N = len(S2)
    for i in range(N // 2):
        if S2[i] == S2[N - i - 1]:
            continue
        else:
            flag = False

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

Solution (Python):
s=input()
L=len(s)
l=s[:L//2]
r=s[L//2+1:]
def check(S,d):
    for i in range(d//2):
        if S[i]!=S[-i-1]:return False
    return True
if check(l,L//2) and check(r,L//2) and check(s,L):print("Yes")
else:print("No")

Solution (Python):
s = list(input())
sa = list(reversed(s))
a = s[0:(len(s)-1)//2]
b = s[(len(s)+3)//2-1:len(s)]
c = list(reversed(a))
d = list(reversed(b))
if s == sa and a==c and b == d:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
n = len(s)
s = [s[i] for i in range(n)]

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

left = s[:l]
right = s[r - 1:]

if s == list(reversed(s)) and left == list(reversed(left)) and right == list(reversed(right)):
    print('Yes')
else:
    print('No')

Solution (Python):
def fn1(s):
	return s == s[::-1]
def fn2(s):
	n = len(s)
	x = s[:(n-1)//2]
	return x == x[::-1]
def fn3(s):
	n = len(s)
	x = s[(n+1)//2:]
	return x == x[::-1]

s = input()

if fn1(s) and fn2(s) and fn3(s):
	print('Yes')
else:
	print('No')

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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")
    exit()
print("No")

Solution (Python):
def main():
    s = list(input())
    n = len(s)
    for i in range(n//2):
        if s[i] == s[-(i+1)]:
            continue
        else:
            print('No')
            return
    s1 = s[:n//2]
    for i in range(len(s1)//2):
        if s1[i] == s1[-(i+1)]:
            continue
        else:
            print('No')
            return

    s1 = []
    s1 = s[n//2 + 1:]
    for i in range(len(s1)//2):
        if s1[i] == s1[-(i+1)]:
            continue
        else:
            print('No')
            return

    print('Yes')

if __name__=='__main__':
    main()

Solution (Python):
s = input()
flg = True

if s != s[::-1]:
    flg = False
    
part1 = s[0:int((len(s)-1)/2)]
if part1 != part1[::-1]:
    flg = False
    
part2 = s[int((len(s)+3)/2 -1):len(s)]
if part2 != part2[::-1]:
    flg = False
    
if flg:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()

index1 = (len(S)-1)//2
index2 = (len(S)+3)//2
S_sub1 = S[:index1]
S_sub2 = S[index2-1:]

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

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

def is_kaibun(str_):
    return str_ == str_[::-1]

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

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

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


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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

s = STR()
l = len(s)
if list(s) != list(reversed(s)):
    print('No')
    exit()
if list(s[:(l - 1) // 2]) != list(reversed(s[:(l - 1) // 2])):
    print('No')
    exit()
if list(s[(l + 3) // 2 - 1:l]) != list(reversed(s[(l + 3) // 2 - 1:l])):
    print('No')
    exit()
print('Yes')

Solution (Python):
S = input()
l = len(S)
ans='Yes'
if S!=S[::-1]:
  ans='No'
if S[:(l-1)//2:]!=S[:(l-1)//2:][::-1]:
  ans='No'
if S[(l+3)//2-1::]!=S[(l+3)//2-1::][::-1]:
  ans='No'
  
print(ans)

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

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

    isStrong = True
    half = N // 2
    for i in range(N):
        if i < half:
            if S[i] != S[-i-1]:
                isStrong = False
            if S[i] != S[half-i-1]:
                isStrong = False
        else:
            if S[i] != S[N-i-1]:
                isStrong = False

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):
''' بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ '''

gi = lambda : list(map(int,input().split()))
s = input()
n = len(s)
ss = s[:n//2]
sss = s[-1:-n//2:-1]
if s == s[::-1] and ss == ss[::-1] and sss == sss[::-1]:
	print("Yes")
else:
	print("No")

Solution (Python):
S=input()

N=len(S)


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

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

def solve():
    s = input()
    if not check(s):
        return "No"
    
    if not (check(s[:(len(s) - 1) // 2])):
        return "No"
    if not check(s[(len(s) + 3)// 2 - 1:]):
        return "No"
    return "Yes"

print(solve())

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):
s=input()
for i in range((len(s)-1)//2):
    if s[i]!=s[-i-(len(s)//2)-2]:
        print('No')
        exit()
if s[0:len(s)//2]!=s[len(s)//2+1:-1]+s[-1]:
    print('No')
    exit()
print('Yes')

Solution (Python):
s=list(input())
n=len(s)
flag1=True
flag2=True

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

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

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(S: str):
    N = len(S)
    head = S[:(N-1)//2]
    tail = S[(N-1)//2+1:]

    reversed_head = head[::-1]
    reversed_tail = tail[::-1]
    reversed_S = S[::-1]
    if head == reversed_head and tail == reversed_tail and reversed_S == S:
        print("Yes")
    else:
        print("No")
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)

if __name__ == '__main__':
    main()

Solution (Python):
def kaibun(S):
    ok=True
    for i in range(len(S)//2):
        if S[i]!=S[-1-i]:
            ok=False
            break
    return ok

S=input()
N=len(S)
ok=True
if not kaibun(S):
    ok=False

if not kaibun(S[0:(N-1)//2]):
    ok=False

if not kaibun(S[(N+1)//2:N]):
    ok=False

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

Solution (Python):
S = input()

ans = 0
N = len(S)
if S == S[::-1]:
    ans += 1

s2 = S[0:(N - 1) // 2]
if s2 == s2[::-1]:
    ans += 1

s3 = S[(N + 3) // 2 - 1:N]
if s3 == s3[::-1]:
    ans += 1

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

Solution (Python):
def ispalindrome(str): return 1 if str == str[::-1] else 0
s=input()
n=len(s)
if ispalindrome(s)==1:
    x = int((n-1)/2)
    y = int((n+3)/2)
    sx = s[:x]
    sy = s[y-1:]

    if ispalindrome(sx)!=1:
        print('No')
        exit()
    if ispalindrome(sy)!=1:
        print('No')
        exit()
    else:
        print('Yes')
        exit()
else:
    print('No')

Solution (Python):
import sys
import itertools
input = sys.stdin.readline
sys.setrecursionlimit(100000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


class v:
    def __init__(self, f):
        self.f = f
        self.v = None
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if self.v is None:
            self.v = n
        else:
            self.v = self.f(self.v, n) 


def f(S):
    for s, t in zip(S, S[::-1]):
        if s != t:
            return False
    return True

def main():
    S = input().strip()
    FS = S[:len(S)// 2]
    BS = S[len(S) // 2 + 1:]
    
    if f(S) and f(FS) and f(BS):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Solution (Python):
S = input()

n = len(S)
ans = "Yes"
if S != S[::-1]:
    ans = "No"
A = S[:(n-1)//2]
if A != A[::-1]:
    ans = "No"

B = S[(n+3)//2-1:]
if B != B[::-1]:
    ans = "No"

print(ans)

Solution (Python):
s=list(input())
def kaubun(s):
    f=1
    for i in range(len(s)//2):
        if s[i]!=s[-i]:
            f=0
    if f:
        return True
    else:
        return False

def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True
f1=1 if is_kaibun(s) else 0
f2=1 if is_kaibun(s[:(len(s)-1)//2]) else 0
f3=1 if is_kaibun(s[(len(s)+3)//2-1:]) else 0
if f1 and f2 and f3:
    print("Yes")
else:
    print("No")

Solution (Python):
import math
a = list(input())
b = len(a)
print("Yes" if a == a[::-1] and a[:b//2] == a[:b//2:-1] and a[math.ceil(b/2):] == (a[math.ceil(b/2):])[::-1] else "No")

Solution (Python):
S = list(input())
N = len(S)
ans = 'No'
if S == S[::-1]:
    sub_1 = S[:(N - 1) // 2]
    if sub_1 == sub_1[::-1]:
        sub_2 = S[(N + 2) // 2:]
        if sub_2 == sub_2[::-1]:
            ans = 'Yes'
print(ans)

Solution (Python):
s=input()
n=len(s)
ok=True
for i in range(int(n//2)):
    if s[i]!=s[n-i-1]:
        ok=False

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

for i in range(int((n//2)//2)):
    if s[n//2+1+i]!=s[n-i-1]:
        ok=False

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

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

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

if solve(S) and solve(S1) and solve(S2):
    print("Yes")
else:
    print("No")

Solution (Python):



def solve(*args: str) -> str:
    S = args[0]
    n = len(S)

    strong = True
    for s in [S, S[:(n-1)//2], S[(n+3)//2-1:]]:
        strong &= s == s[::-1]

    return 'Yes' if strong else 'No'


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

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

flag = [0] * 3

if s == s[::-1]:
    flag[0] = 1

a = int((n - 1) * 0.5)
sa = s[:a]
if sa == sa[::-1]:
    flag[1] = 1

b = int((n + 3) * 0.5)
sb = s[(b - 1):]
if sb == sb[::-1]:
    flag[2] = 1

if sum(flag) == 3:
    print("Yes")
else:
    print("No")

Solution (Python):
S=input()
center=len(S)//2
if len(S)%2==0:
    print("No")
else:
    if S[:center]==S[center+1:]:
        print("Yes")
    else:
        print("No")

Solution (Python):
S = input()

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

Solution (Python):
s=input()
n=len(s)
ng=0
for i in range(n//2):
    
    if s[i]!=s[-i-1]:
        ng=1

for i in range(((n-1)//2)//2):
    
    if s[i]!=s[-i-1+(n-1)//2]:
        ng=1

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

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

Solution (Python):
S = input()
N = len(S)
flag = True
for i in range(N//2):
    if S[i] == S[-1-i]:
        continue
    flag = False
    break

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp



class UnionFindEx:
    def __init__(self, size):
        
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'

def main():
    S = input()
    s = S[:len(S)//2]
    if all(a==b for a,b in zip(S, reversed(S))) and all(a==b for a,b in zip(s, reversed(s))):
        print(Yes)
    else:
        print(No)


main()

Solution (Python):









import sys



readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    s = input()
    l = len(s)
    lh = (l - 1) // 2

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

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

    lhh = len(s1) // 2

    for i in range(lhh):
        if s1[i] != s[-1 - i]:
            print('No')
            sys.exit()
        if s2[i] != s[-1 -i]:
            print('No')
            sys.exit()

    print('Yes')


if __name__ == '__main__':
    main()

Solution (Python):
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

def main():
    s = readline().strip()
    N = len(s)

    t = s[::-1]
    if s == t:
        u = s[:N//2]
        v = s[N//2+1:]
        if u == u[::-1] and v == v[::-1]:
            print("Yes")
            exit()
    
    print("No")
    

if __name__ == "__main__":
    main()

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

Solution (Python):
S = raw_input()

N = len(S)

is_flag = True
for i in range(N):
    if S[i] != S[N-1-i]:
        is_flag = False

M = (N-1)/2
for i in range(M/2):
    if S[i] != S[M-1-i]:
        is_flag = False


for i in range(M/2):
    if S[i+(N+1)/2] != S[N-1-i]:
        is_flag = False


if is_flag:
    print "Yes"
else:
    print "No"

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

ans = True


i = 0
j = mm-1
while(1):
    if i==j or j<i:
        break

    if S[i]!=S[j]:
        ans = False
        break
    i += 1
    j -= 1


i = 0
j = (mm-1)//2-1
while(1):
    if i==j or j<i:
        break
    if S[i]!=S[j]:
        ans = False
        break
    i += 1
    j -= 1


i = (mm+3)//2-1
j = mm-1
while(1):
    
    if i==j or j<i:
        break
    if S[i]!=S[j]:
        ans = False
        break
    i += 1
    j -= 1

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

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

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

Solution (Python):
def x(s):
	n = len(s)
	x1 = (n - 1) // 2
	x2 = (n + 3) // 2
	t = s[:x1]
	u = s[x2 - 1:]
	return (s == s[::-1]) and (t == t[::-1]) and (u == u[::-1])
s = input()
print('Yes' if x(s) else 'No')

Solution (Python):
s = input().strip()
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")

Solution (Python):
s = input()
n = len(s)
tmp_1 = (n-1) // 2

tmp_2 = (n+3) // 2

tmp_1_s = s[:tmp_1]
tmp_2_s = s[tmp_2-1:n]
if s == s[::-1] and tmp_1_s == tmp_1_s[::-1] and tmp_2_s == tmp_2_s[::-1]:
    print('Yes')
else:
    print('No')

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

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


s = input()
n = len(s)
if s[::-1] != s:
    print("No")
    exit()

mae = s[:(n-1)//2]
usito = s[(n+3)//2-1:]
meee = mae[::-1]
usi = usito[::-1]
if meee == mae and usi == usito:
    print("Yes")
else:
    print("No")

Solution (Python):
"""
NTC here
"""
import sys
inp = sys.stdin.readline


def input(): return inp().strip()


flush = sys.stdout.flush





def iin(): return int(input())


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





def main():
    def fn(s):
        l = len(s)
        l, r = 0, l-1
        while l<r:
            if s[l]!=s[r]:
                return False
            l+=1
            r-=1
        return True
    s = input()
    n = len(s)
    print("Yes" if fn(s) and fn(s[:n//2]) else "No")

main()

Solution (Python):
def solve(S):
    if S != S[::-1]:
        return "No"
    h = (len(S) - 1)//2
    h2 = (len(S) + 3)//2
    A = S[:h]
    B = S[h2-1:]
    if A != A[::-1]:
        return "No"
    if B != B[::-1]:
        return "No"
    return "Yes"


if __name__ == "__main__":
    S = input()
    print(solve(S))

Solution (Python):
s = input()
n = len(s)
def check(x):
    for i in range(len(x)):
        if x[i] != x[-1-i]:
            return False
    return True

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

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

def is_pal(X):
    ret = True
    for i in range(len(X)//2+1):
        if X[i] != X[-i-1]:
            ret = False
    return ret


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

Solution (Python):
s = input()
n = len(s)
l = (n - 1)//2 - 1
r = (n + 3) //2 -1

s1 = s[:l+1]
s2 = s[r:]

sr = s[::-1]
s1r = s1[::-1]
s2r = s2[::-1]

if s == sr and s1 == s1r and s2 == s2r:
    print("Yes")
else:
    print("No")

Solution (Python):
s= input()

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

if f(s) and f(s[0:(len(s)-1)//2]) and f(s[(len(s)+3)//2-1:]):
    print("Yes")
else:
    print("No")

Solution (Python):



def main():
    import sys
    sys.setrecursionlimit(10**6)
    

    def dump(*args):
        sys.stderr.write(str(args))

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


if __name__ == '__main__':
    main()

Solution (Python):
s = input()
s2 = s[::-1]
n = len(s)
sa=s[:(n-1)//2]
sa2 = sa[::-1]
sb=s[(n+1)//2:]
sb2 = sb[::-1]
if s==s2 and sa == sa2 and sb==sb2:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()

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

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

print(ans)

Solution (Python):
s = input()

n = len(s)

def K(x):
    l = len(x)
    for i in range(l):
        if x[i] != x[l-1-i]:
            return False
    return True

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

Solution (Python):

import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


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


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(S):
    def p(s):
        for i in range(len(s)):
            if s[i] != s[-i-1]:
                return False
        return True
    N = len(S)
    if p(S) and p(S[:(N-1)//2]) and p(S[(N+3)//2-1:]):
        return 'Yes'
    return 'No'


def main():
    S = read_str()
    print(slv(S))


if __name__ == '__main__':
    main()

Solution (Python):
s=input()
n=len(s)
first=s[:(n-1)//2]
last=s[(n+3)//2-1:]

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = input()
N = len(S)

ans = 'Yes'

mid1 = (N - 1) // 2
mid2 = ((N + 3) // 2) - 1

one = S[:mid1]
two = S[mid2:]


if not(one == one[::-1] and two == two[::-1]):
    ans = 'No'

if not (S == S[::-1]):
    ans = 'No'

print(ans)

Solution (Python):


from sys import stdin
import sys
sys.setrecursionlimit(10**8)

def getInputs():
	inputs=[]
	for line in stdin:
		line=line.split()
		inputs.append(line)
	return inputs

def r(x):
	return x[::-1]


def main(inputs):
	s=inputs[0][0]
	n=len(s)
	if s[::-1]!=s:
		print("No")
		sys.exit(0)

	if s[0:(n-1)//2]!=r(s[0:(n-1)//2]):
		print("No")
		sys.exit(0)

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

if __name__=="__main__":
	inputs=getInputs()

	main(inputs)

Solution (Python):
def main():
    S = input()
    def helper(s):
        l, r = 0, len(s) -1
        while l < r:
            if s[l] != s[r]:
                return False
            l += 1
            r -= 1
        return True

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

main()

Solution (Python):
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')

S = input()

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

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

Solution (Python):

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

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

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

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

if not check(S):
    print('No')
    quit()

S1 = S[:(N-1)//2]
if not check(S1):
    print('No')
    quit()

S2 = S[(N+3)//2-1:]
if not check(S2):
    print('No')
    quit()


print('Yes')

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

N = len(S)

flag = True

for i in range(N):
    if S[i] == S[N - 1 - i]:
        pass
    else:
        print ('No')
        exit()

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

count = 0
for i in range((N + 3) // 2 - 1, N):
    if S[i] == S[N - 1 - count]:
        count += 1
    else:
        print ('No')
        exit()

print ('Yes')

Solution (Python):
from collections import deque
def main():
    s = list(input())

    leftsub = s[0:len(s)//2]
    rightsub = s[len(s)//2+2:-1]

    if isPalindrome(s) and isPalindrome(leftsub) and isPalindrome(rightsub):
        print("Yes")
        return
    print("No")

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

    for i in range(len(s)//2):
        if s[i]!=s_rev[i]:
            return False

    return True
    


if __name__ == "__main__":
    main()

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


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


if __name__ == '__main__':
    resolve()

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

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

cta=0
for i in range(n):
  if s[i]!=s[n-1-i]:
    cta+=1

s2=s[0:(n-1)//2]
n2=len(s2)
ctb=0
m=(n-1)//2
for i in range(n2):
  if s2[i]!=s2[n2-1-i]:
    ctb+=1

s3=s[(n+3)//2-1:n+1]
n3=len(s3)
ctc=0
x=(n+3)//2
for i in range(n3):
  if s[i]!=s[n3-1-i]:
    ctc+=1

if cta==0 and ctb==0 and ctc==0:
  print('Yes')
else:
  print('No')

Solution (Python):
def kaibun(s):
    ns=len(s)
    f=True
    for i in range(ns//2):
        if s[i]!=s[ns-i-1]:
            f = False
    return f

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

Solution (Python):
S=input()
N=len(S)
F=0
if S!=S[::-1]:
    F=1
s1=S[:(N-1)//2]
if s1!=s1[::-1]:
    F=1
s2=S[(N+3)//2-1:]
if s2!=s2[::-1]:
    F=1
if F==0:
    print("Yes")
else:
    print("No")

Solution (Python):
s=list(input())
n=len(s)
s1=s[:n//2]
s2=s[n//2+1:]
s1r=s1[::-1]
s2r=s2[::-1]
if s1==s1r and s2==s2r and s1==s2:
    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):
st = input()
n = len(st)
temp1 = st[:(n-1)//2]
temp2 = st[(n+3)//2-1:]
if st==st[::-1] and temp1 == temp1[::-1] and temp2==temp2[::-1]:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()

n = len(S)
l = S[:(n-1)//2]
r = S[(n+3)//2 - 1:]
if S[::-1] == S:
    if r == r[::-1] and l == l[::-1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Solution (Python):
def palindrome(s):
    return s == s[::-1]


def judge(s):
    return palindrome(s) and palindrome(s[0:(len(s)-1)//2]) and palindrome(s[(len(s)-1)//2+1:])


S = input()
print('Yes' if judge(S) else 'No')

Solution (Python):
s = input()

l = len(s)
f=0
for i in range(l):
    if s[i]!=s[l-i-1]:
        f=1
n = l//2
for i in range(n):
    if s[i]!=s[n-i-1]:
        f=1
m = (l+3)//2
for i in range(m,l):
    if s[i]!=s[l-i-1]:
        f=1
if f==0:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input().rstrip()
n = (len(s) - 1) // 2
s_h = s[:n]
if s == s[::-1] and s_h == s_h[::-1]:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

    if S != S[::-1]:
        print("No")
        return

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

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

    print("Yes")


if __name__ == '__main__':
    main()