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 itertools
import sys
import math
import numpy as np
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
sys.setrecursionlimit(10**9)

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

    def is_kaibun(s,e):
        for i in range(s,e-s+1):
            if S[e-i] != S[i]:
                return False
        return True

    if is_kaibun(0,(N-1)//2-1) and is_kaibun(0,N-1)  and is_kaibun((N+3)//2-1,N-1):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
  main()

Solution (Python):

S = input()
l = len(S)
l2 = (l-1)//2
l3 = (l+3)//2
judge = 1
for i in range(l):
    if S[i] != S[l-1-i]:
        judge = 0
for i in range(l2):
    if S[i] != S[l2-1-i]:
        judge = 0
    if S[l-1-i] != S[l3-1+i]:
        judge = 0

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

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

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

Solution (Python):
S = input()
N = len(S)
flag = True
for i in range(N//2+1):
    if S[i] != S[-i-1]:
        flag = False
        break
if flag:
    s2 = S[:N//2]
    n2 = len(s2)
    ans = 'Yes'
    for i in range(n2):
        if s2[i] != s2[-i-1]:
            ans = 'No'
            break
    print(ans)
    
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 math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

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

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     

def iskaibun(s):
    l = 0
    r = len(s) - 1
    while l < r:
        if s[l] == s[r]:
            l += 1
            r -= 1
            continue
        else:
            return False
    return True

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

main()

Solution (Python):
import unittest


class TestB(unittest.TestCase):
    def test_1(self):
        self.assertEqual(think('akasaka'), 'Yes')

    def test_2(self):
        self.assertEqual(think('level'), 'No')

    def test_3(self):
        self.assertEqual(think('atcoder'), 'No')


def solve():
    s = read()
    result = think(s)
    write(result)


def read():
    return read_line()


def read_int(n):
    return read_type(int, n, sep=' ')


def read_float(n):
    return read_type(float, n, sep=' ')


def read_type(t, n, sep):
    return list(map(lambda x: t(x), read_line().split(sep)))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(s):
    if not is_palindrome(s):
        return 'No'
    m = len(s) // 2
    if is_palindrome(s[0:m]) and is_palindrome(s[m + 1:]):
        return 'Yes'
    return 'No'


def write(result):
    print(result)


def is_palindrome(s):
    right = len(s) - 1
    for left in range(len(s)):
        if s[left] == s[right]:
            right -= 1
            continue
        return False
    return True


if __name__ == '__main__':
    
    solve()

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):
pal = lambda x : 1 if x==x[::-1] else 0
s=input();n=len(s)

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

Solution (Python):
S = input()
N = len(S)
ans = True
h = (N-1)//2
for i in range(h + 1):
    if S[i] != S[-1-i]: ans = False
hh = h // 2
for i in range(hh+1):
    if S[i] != S[-1-h-1-i]: ans = False
print('Yes' if ans else 'No')

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(S: str):

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

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

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

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

Solution (Python):
x=input()
x=list(x)
p=0
for i in range(len(x)):
	if x[len(x)-i-1]!=x[i]:
		p=1
if p==0:
	for i in range(((len(x)-1)//2)-1):
		if x[i]!=x[((len(x)-1)//2)-1-i]:
			p=1

if p==0:
	for i in range((len(x)+3),len(x)):
		if x[i]!=x[len(x)-i-1]:
			p=1

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

Solution (Python):
S=input()
N=len(S)
flag1=1
flag2=1
flag3=1
for i in range(N//2):
    if S[i]!=S[N-1-i]:
        flag1=0
s2=S[:(N-1)//2]
s3=S[(N+1)//2:]

for i in range((N-1)//4):
    if s2[i]!=s2[((N-1)//2)-1-i]:
        flag2=0
    if s3[i]!=s3[((N-1)//2)-1-i]:
        flag3=0
if flag1+flag2+flag3==3:
    print("Yes")
else:
    print("No")

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

Solution (Python):






import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache






MOD = 10**9 +7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr


def lcm(a, b):
    return a * b // gcd (a, b)





S = inputS()

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

L = len(S)

if check(S) and check("".join(list(S)[:(L-1)//2])) and check("".join(list(S)[(L+1)//2:])):
  print("Yes")
else:
  print("No")

Solution (Python):
s = input()

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

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

if not is_kaibun(s[:(len(s)-1)//2]):
    print('No')
    exit()

if not is_kaibun(s[(len(s)+3)//2-1:]):
    print('No')
    exit()

print('Yes')

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

Solution (Python):
def main():
    S = input()
    N = len(S)
    for i in range(N//2):
        if S[i] != S[N - 1 - i]:
            return False
    x = (N-1)//2
    for i in range((N-1)//2):
        if S[i] != S[x - 1 - i]:
            return False
    for i in range(x + 1,N):
        if S[i] != S[N - 1 - i]:
            return False
    return True
if main():
    print('Yes')
else:
    print('No')

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

s = input()
n = len(s)
if is_palindrome(s) and is_palindrome(s[:n // 2]) and is_palindrome(s[-(n // 2):]):
    print('Yes')
else:
    print('No')

Solution (Python):
S = input()

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

half = len(S)//2

left = S[:half]
right = S[half+1:]

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

Solution (Python):
s = input()
ans = 'Yes'
if not s == ''.join(s[::-1]):
    ans = 'No'
temp = s[:(len(s)-1)//2]
if not temp == ''.join(temp[::-1]):
    ans = 'No'
temp = s[(len(s)+2)//2:]
if not temp == ''.join(temp[::-1]):
    ans = 'No'
print(ans)

Solution (Python):
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]

s=input()
n=len(s)
left=s[:(n-1)//2]
right=s[(n+3)//2-1:]


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

Solution (Python):
s = list(input())
s2 = list(reversed(s))
ss = s[:((len(s)-1)//2)]
ss2 = list(reversed(ss))
sss = s[-((len(s)-1)//2):]
sss2 = list(reversed(sss))
if s == s2 and ss == ss2 and sss == sss2:
         print("Yes")
else:
         print("No")

Solution (Python):
S = input()
N = len(S)
def isKaibun(s):
	l = len(s)
	for i in range(l):
		if s[i] != s[l-1-i]:
			return False
	return True

if not isKaibun(S):
	print("No")
	exit()
if not isKaibun(S[:(N-1)//2]):
	print("No")
	exit()
if not isKaibun(S[(N+3)//2 - 1:]):
	print("No")
	exit()
print("Yes")

Solution (Python):
import sys
import math
import bisect

def solve(s):
    n = len(s)
    if n % 2 == 0:
        return False
    m = (n - 1) // 2
    if s != s[::-1]:
        return False
    left = s[:m]
    right = s[m+1:]
    if left != left[::-1]:
        return False
    if right != right[::-1]:
        return False
    return True

def main():
    if solve(input()):
        print('Yes')
    else:
        print('No')

if __name__ == "__main__":
    main()

Solution (Python):


def resolve():
    S=input()
    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()

Solution (Python):
import sys


def input():
    return sys.stdin.readline()[:-1]

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

Solution (Python):
s =str(input())
flag = True
for i in range((len(s)-1)//2):
     if s[i] != s[i + (len(s)+3)//2-1] or s[i] != s[(len(s)-1)//2-i-1]:
          flag = False



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

Solution (Python):
S = input()
ans = False
a = S[:(len(S) - 1) // 2]
b = S[(len(S) + 3) // 2 - 1:]
if S == S[::-1] and a == a[::-1] and b == b[::-1]:
    ans = True
print('Yes' if ans else 'No')

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline

    S = input().rstrip('\n')
    N = len(S)
    ok = 1
    for i in range(N):
        if S[i] != S[-i-1]:
            ok = 0
        if i < N // 2:
            if S[i] != S[N//2 - i - 1]:
                ok = 0
        if i > N // 2:
            if S[i] != S[-(i - N//2 - 1) - 1]:
                ok = 0
    if ok:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Solution (Python):
S = input()
N = len(S)
if S == S[::-1]:
    tmp = S[:(N - 1) // 2]
    if tmp == tmp[::-1]:
        t = S[(N + 3) // 2 - 1:N]
        if t == t[::-1]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H, n_cols):
    '''
    H is number of rows
    n_cols is number of cols
    A列、B列が与えられるようなとき
    '''
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])
    return ret


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


def read_map(H):
    '''
    H is number of rows
    文字列で与えられた盤面を読み取る用
    '''
    return [read()[:-1] for _ in range(H)]


def read_map_as_int(H):
    '''
    
    '''
    ret = []
    for _ in range(H):
        ret.append([1 if s == '
        
        
    return ret


MOD = 10**9 + 7

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  

S = input()
N = len(S)


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


flg = True
flg = flg and is_kaibun(S)
flg = flg and is_kaibun(S[:N // 2])
flg = flg and is_kaibun(S[N // 2 + 1:])
print('Yes' if flg else 'No')

Solution (Python):
from math import *

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

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

Solution (Python):
S = input()

l = len(S)

first = S[0:(l-1)//2]
second = S[(l+3)//2-1:]

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

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

ans = "Yes"

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

print(ans)

Solution (Python):
import sys
input=sys.stdin.readline
s=input().rstrip()
n=len(s)
check=True
for i in range(n-1//2):
    if s[i]==s[n-1-i]:
        pass
    else:
        check=False
for i in range(((n-1)//2)//2):
    if s[i]==s[(n-1)//2-1-i]:
        pass
    else:
        check=False
for i in range(((n-1)//2)//2):
    if s[(n+1)//2+i]==s[(n+1)//2+(n-1)//2-1-i]:
        pass
    else:
        check=False
if check:
    print('Yes')
else:
    print('No')

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

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

Solution (Python):
def main():
    S = input()
    n = N= len(S)
    def pal(s):
        return s == s[::-1]

    return pal(S) and pal(S[:(n - 1) // 2]) and pal(S[(N + 3) // 2 - 1:])

print('Yes' if main() else 'No')

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  

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

def solve(S: str):
    all = is_kaibun(S)
    zenhan = is_kaibun(S[:len(S)//2])
    kouhan = is_kaibun(S[len(S)//2+1:])
    if all and zenhan and kouhan:
        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):
import math
S = input()

N = len(S)
S_left = S[:math.ceil((N - 1) / 2)]
S_right = S[(N + 3) // 2 - 1:]


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

Solution (Python):
s = input()
n = len(s)
s_1 = s[:(n-1)//2]
s_2 = s[(n-1)//2 +1:]
s_1_new = ''.join(list(reversed(s_1)))
s_2_new = ''.join(list(reversed(s_2)))
s_new = ''.join(list(reversed(s)))
if s == s_new and s_1 == s_1_new and s_2 == s_2_new:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

def is_ok(s):
    return s == ''.join(reversed(s))

def main():
    s = input().strip()
    n = len(s)
    if is_ok(s) and is_ok(s[0:(n-1)//2]) and is_ok(s[(n+3)//2-1:n]):
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
n = len(s)
s1 = s[:n//2]
s2 = s[n//2 + 1:]
s1r = s1[::-1]
s2r = s2[::-1]
if s1 == s1r and s1 == s2 and s2 == s2r:
    print("Yes")
else:
    print("No")

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

Solution (Python):
def judge(left, right):
    while left < right:
        if s[left] != s[right]:
            return False
        left += 1
        right -= 1
    return True


s = input()
n = len(s)

if judge(0, n-1) and judge(0, (n-1)//2-1) and judge((n+3)//2-1, n-1):
    print("Yes")
else:
    print("No")

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

Solution (Python):
S = input()


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


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

Solution (Python):
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
from fractions import gcd
from copy import deepcopy
import math
import queue
import numpy as np

Mod = 1000000007
import sys
sys.setrecursionlimit(100000) 
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

def main(): 
    ss = input()
    s = [i for i in ss]
    n = len(s)
    print("Yes" if (s[:(n-1)//2] == s[:(n-1)//2][::-1] and s[(n+3)//2:] == s[(n+3)//2:] and s == s[::-1]) else "No")
        
if __name__ == "__main__":
    main()

Solution (Python):
s = input()
n = len(s)
s1 = s[::-1]
if s == s1:
    s2 = s[: (n - 1) // 2]
    s3 = s2[::-1]
    if s3 == s2:
        s4 = s[(n + 3) // 2 - 1: ]
        s5 = s4[::-1]
        if s4 == s5:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


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


def solve(S: str):
    n = len(S)
    if isp(S) and isp(S[:(n-1)//2]) and isp(S[(n+1)//2:]):
        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 main():

    S = input()
    N = len(S)
    pair = [[0, N-1], [0, (N-1)//2-1], [(N+3)//2-1, N-1]]
    for i, j in pair:
        d = j-i+1
        for k in range(d//2):
            if S[i+k] != S[j-k]:
                return "No"
    return "Yes"

if __name__ == '__main__':
    print(main())

Solution (Python):
S=input()
N=len(S)
s1=S[:N//2]
s2=S[N//2+1:]

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

if f(s1)==True and f(s2)==True and f(S)==True:
  print('Yes')
else:
  print('No')

Solution (Python):
S = input()

N = len(S)

ans = True
for i in range(N//2):
    ans = ans and S[i]==S[N-1-i]

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

for i in range(N2//2):
    ans = ans and S1[i] == S1[N2-1-i]
    ans = ans and S2[i] == S2[N2-1-i]

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

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

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

flg = S == S[::-1]
if flg: flg = a == a[::-1]
if flg: flg = b == b[::-1]

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

Solution (Python):
s = input()


def isKai(t):
  return list(t) == list(reversed(list(t)))


n = len(s)

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

Solution (Python):


import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    s = ns()
    n = len(s)
    s1 = s[:(n-1)//2]
    s2 = s[(n+3)//2-1:]
    ans = "Yes"
    if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

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

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

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

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

print("Yes")

Solution (Python):
def examA():
    N, M = LI()
    ans = N*(N-1)//2 + M*(M-1)//2
    print(ans)
    return

def examB():
    def judge(A):
        
        n = len(A)
        for i in range(n//2):
            if A[i]!=A[n-i-1]:
                return False
        return True
    S = SI()
    N = len(S)
    if not judge(S):
        print("No")
        return
    if judge(S[:(N-1)//2]) and judge(S[(N+1)//2:]):
        print("Yes")
    else:
        print("No")
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examB()

"""

"""

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

Solution (Python):
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left 

sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input():
    return sys.stdin.readline()[:-1]
def pri(x):
    if type(x) is list:
        print('\n'.join(map(str, x)))
    else:
        print(x)

S = input()
N = len(S)
rS = ''.join(list(reversed(S)))

S2 = S[:(N-1)//2]
rS2 = ''.join(list(reversed(S2)))

S3 = S[(N+3)//2-1:]
rS3 = ''.join(list(reversed(S3)))

if S==rS and S2==rS2 and S3==rS3:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()

n = len(s)

a = s[:(n-1)//2]

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

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

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

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

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

def main():
    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__':
    main()

Solution (Python):
S = input()
N = len(S)
A = S[:int((N-1)/2)]
B = S[int((N+3)/2)-1:]
out = 0

for i in range(N):
    if S[i]!=S[N-i-1]:
        out = 1
for i in range(len(A)):
    if A[i]!=A[len(A)-i-1]:
        out = 1
for i in range(len(B)):
    if B[i]!=B[len(B)-i-1]:
        out = 1

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

Solution (Python):


s = input()

flag = s == s[::-1]
n = len(s)
cond2 = s[:(n-1)//2]
flag &= cond2 == cond2[::-1]
cond3 = s[(n+3)//2-1:]
flag &= cond3 == cond3[::-1]

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

Solution (Python):
s=input()
x=len(s)
def is_pal(x):
  return x==x[::-1]
if is_pal(s) and is_pal(s[:(x-1)//2]) and is_pal(s[(x+3)//2-1:]):
  print("Yes")
else:
  print("No")

Solution (Python):
S = input().strip()
N = len(S)
R = S[::-1]

if S != R:
    print('No')
    exit()

S2 = S[:(N-1)//2]
R2 = S2[::-1]
if S2 != R2:
    print('No')
    exit()

S3 = S[(N+3)//2-1:]
R3 = S3[::-1]
if S3 != R3:
    print('No')
    exit()

print('Yes')

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

Solution (Python):
s = input()
ret = "No"
if s==s[::-1]:
    s1=s[:(len(s)-1)//2]
    s2=s[(len(s)+3)//2-1:]
    if s1==s1[::-1] and s2==s2[::-1]:
        ret = "Yes"
print(ret)

Solution (Python):
s=input()
t=s[0:(len(s)-1)//2]
u=s[(len(s)+3)//2-1:]

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

Solution (Python):
def main():
    s = input()

    def kaibun(seq):
        l = len(seq)
        for i in range(l//2):
            if seq[i] != seq[-i-1]:
                return False
        return True
    n = len(s)
    if kaibun(s) and kaibun(s[:(n-1)//2]) and kaibun(s[(n+3)//2-1:]):
        print("Yes")
    else:
        print("No")


main()

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

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


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

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

Solution (Python):
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(1000000)


INF = int(1e10)

def input():
    return stdin.readline()[:-1]

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

def main():
    from builtins import int, map
    S = input()
    N = len(S)
    if is_kaibun(S) and is_kaibun(S[:N // 2]) and is_kaibun(S[N // 2 + 1:]):
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Solution (Python):

s = input()

n = len(s)
ss = s[:(n-1)//2]
sss = s[(n+3)//2-1:]

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

Solution (Python):
s = input()
s1 = s[::-1]
if s == s1:
    s2 = s[:(len(s) - 1) // 2]
    s3 =s2[::-1]
    if s2 == s3:
        s4 = s[(len(s) + 1) // 2:]
        s5 = s4[::-1]
        if s4 == s5:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")