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

S = stdin.readline().rstrip()
N = int(len(S))

S_reversed = "".join(list(reversed(S)))

S1 = S[0:int((N-1)/2)]
S1_reversed = "".join(list(reversed(S1)))


S2 = S[int((N+3)/2)-1:N]
S2_reversed = "".join(list(reversed(S2)))

answer = "Yes"

for i in range(N):
    if S[i] == S_reversed[i]:
        pass
    else:
        answer = "No"

for i in range(int((N-1)/2)):
    if S1[i] == S1_reversed[i]:
        pass
    else:
        answer = "No"

for i in range(int(N-(N+3)/2)):
    if S2[i] == S2_reversed[i]:
        pass
    else:
        answer = "No"

print(answer)

Solution (Python):

"""
Created on Sun Mar 22 21:21:55 2020

@author: azikausy
"""


S = input()
N = len(S)
forw = S[:int((N-1)/2)]
back = S[int((N+3)/2)-1:]

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

Solution (Python):


S = input()
N = len(S)

half = int((N-1)/2)

flg = True
for i in range(int((half-1)/2)):
    if S[i] != S[half-1-i]:
        flg = False
        break
if flg == True and S[:half] == S[half+1:]:
    print("Yes")
else:
    print("No")

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

s=input()
list_s=list(s)
n=len(list_s)
m=int((n-1)/2)
if list_s[0:m] == list(reversed(list_s[m+1:])):
    if is_kaibun(s[0:m]):
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

if bs == fs:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys

S = input()
S1 = ''
S2 = ''
if S == S[::-1]:
    S1 = S[0:(len(S) - 1) // 2]
    if S1 == S1[::-1]:
        S2 = S[(len(S) + 3) // 2 - 1:]
        if S2 == S2[::-1]:
            print('Yes')
            sys.exit()
print('No')

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


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

main()

Solution (Python):
s = input()
n = len(s)
def judge(string):
    k = len(string)
    flag = True
    for i in range(k//2):
        if string[i] != string[-i-1]:
            flag = False
            break
    return flag
s1 = s[:(n-1)//2]
s2 = s[(n+3)//2-1:]
if judge(s) and judge(s1) and judge(s2):
    print("Yes")
else:
    print("No")

Solution (Python):
S = list(input())
S_r = S[::-1]
N = len(S)
if S[:(N - 1)//2] == S_r[:(N - 1)//2]:
    T = S[:(N - 1)//2]
    T_r = T[::-1]
    if T == T_r:
        print('Yes')
    else:
        print('No')
else:
    print('No')

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

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

num = int((len(s)-1) / 2)
num2 = int((len(s)+3) / 2)

f = s[:num]
b = s[num2-1:len(s)]

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

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

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

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

a = (N-1) // 2
b = (N+3) // 2






if S == ''.join(list(reversed(S))):
  if S[0:a] == ''.join(list(reversed(S[0:a]))):
    if S[b-1:] == ''.join(list(reversed(S[b-1:]))):
      print('Yes')
      exit()

print('No')

Solution (Python):
input_S = input()

S = list(input_S)
N = len(S)
ans = 0

for num in range(N):
    if S[num] != S[N - num - 1]:
        ans = 1

for num in range(int((N - 1) / 2)):
    if S[num] != S[int((N - 1) / 2 - num - 1)]:
        ans = 1

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

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

front = s[0:int((n-1)/2)]
back = s[int((n+3)/2)-1:n]

if s != s[::-1]:
    print("No")
else:
    if front == front[::-1] and back == back[::-1]:
        print("Yes")
    else:
        print("No")

Solution (Python):
text_ = input()

if text_ != text_[::-1]:
    print('No')
elif text_[:((len(text_)-1) // 2)] != text_[:((len(text_)-1) // 2)][::-1]:
    print('No')
elif text_[((len(text_)+3)//2)-1:] != text_[((len(text_)+3)//2)-1:][::-1]:
    print('No')
else:
    print('Yes')

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

for i in range(n):
    if s[i] != s[n-1-i]:
        judge = False

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

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

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

Solution (Python):
s = input()
s_len = len(s)
 
def judge(start=0, end=s_len):
  for i in range(start, end):
    if s[i] == s[end-1-i]:
      continue
    else:
      return 0
  return 1
 
if judge() and judge(end=(s_len-1)//2) and judge(start=(s_len+3)//2-1):
  print("Yes")
else:
  print("No")

Solution (Python):
S = input()
S = list(S)
S_1 = S[0:int((len(S)-1)/2)]
S_2 = S[int((len(S)-1)/2)+1:len(S)]
S_2.reverse()

if S_1 == S_2:
    if len(S_1) % 2 == 0:
        S_1_1 = S_1[0:int((len(S_1)-1)/2)+1]
        S_1_2 = S_1[int((len(S_1)-1)/2)+1:len(S_1)]
        S_2_1 = S_2[0:int((len(S_2)-1)/2)+1]
        S_2_2 = S_2[int((len(S_2)-1)/2)+1:len(S_2)]
    else:
        S_1_1 = S_1[0:int((len(S_1)-1)/2)]
        S_1_2 = S_1[int((len(S_1)-1)/2)+1:len(S_1)]
        S_2_1 = S_2[0:int((len(S_2)-1)/2)]
        S_2_2 = S_2[int((len(S_2)-1)/2)+1:len(S_2)]
    S_1_2.reverse()
    S_2_2.reverse()
    if S_1_1 == S_1_2:
        if S_2_1 == S_2_2:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

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

s = input()
n = len(s)

kai1 = int((n - 1) / 2)
kai2 = int((n + 3) / 2)

first = s[0:kai1]
second = s[kai2-1:n]
if palindrome(s) == 0:
    if palindrome(first) == 0:
        if palindrome(second) == 0:
            print('Yes')
            exit()

print('No')

Solution (Python):
def hantei(s):
    rev_s = s[::-1]

    for x in range(len(s)):
        if s[x] != rev_s[x]:
            return False
    
    return True

s = input()

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

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

Solution (Python):
S=input()

N=len(S)
s0=list(S)

a=0
b=0
c=0

for i in range(N):
    if s0[i]==s0[N-1-i]:
        c=c+1

for i in range((N-1)//2):
    if s0[i]==s0[(N-1)//2-1-i]:
        a=a+1

for i in range((N+3)//2-1,N):
    if s0[i]==s0[N+(N+3)//2-i-2]:
        b=b+1

if a==b==(N-1)//2 and c==N:
    print('Yes')
else:
    print('No')

Solution (Python):
s=input()
n=len(s)
k=0
s1=s[0:(n-1)//2+1]
s2=s[(n+3)//2-1:]
for i in range(len(s1)):
    if s1[i]==s[-i-1]:
        pass
    else:
        k=1
        break
for j in range(len(s2)):
    if s2[j]==s[-j-1]:
        pass
    else:
        k=1
        break
if k==1:
    print("No")
else:
    print("Yes")

Solution (Python):
def pal(string):
    return True if string==string[::-1] else False

S = input()

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

Solution (Python):
S = list(map(str, input()))
cnt = 0

for i in range(len(S)//2+1):
    if S[i]!=S[len(S)-i-1]:
        cnt += 1

for i in range(len(S)//2):
    if S[i]!=S[(len(S)-1)//2-i-1]:
        cnt += 1

for i in range(len(S)//2):
    if S[(len(S)+3)//2+i-1]!=S[len(S)-i-1]:
        cnt += 1

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

Solution (Python):
s=list(input())
s1=s[:(len(s)//2)]
s2=s[(len(s)//2)+1:]
if s==list(reversed(s)) and s1==list(reversed(s1)) and s2==list(reversed(s2)):
  print('Yes')
else:
  print('No')

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

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

Solution (Python):
S = input()
N = len(S)
for i in range(int((N-1)/2)):
  if S[i] != S[-(i+1)]:
    print("No")
    exit()
half = S[0:int((N-1)/2)]
for i in range(int((N-1)/4)):
  if half[i] != half[-(i+1)]:
    print("No")
    exit()
print("Yes")

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

num = (N-1)/2
num1 = (N+2)/2

if(S[:int(num)]==S[int(num1):]):
    print("Yes")
else:
    print("No")

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

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

if __name__ == "__main__":
    main()

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


s = input()
N = len(s)



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

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

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

Solution (Python):
S = input()

N = len(S)
N1 = (N-1)//2
N2 = (N+3)//2

flag = 0

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

for i in range(N1//2):
    
    if S[i] != S[-(i+1+N1+1)]:
        flag = 1

for i in range(N1//2):
    
    if S[i+N2-1] != S[-(i+1)]:
        flag = 1

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

Solution (Python):

s = list(input())
t1 = []
t2 = []
t1 = s[0:int((len(s)-1)/2)]
t2 = s[int((len(s)-1)/2)+1:]

sr = list(reversed(s))
t1r = list(reversed(t1))
t2r = list(reversed(t2))

if s == sr and t1 == t1r and t2 == t2r:
    print("Yes")
else:
    print("No")

Solution (Python):
strings = list(input())
len_str = len(strings)
ans = "Yes"

for i in range((len_str-1)//2):
  
  if strings[i] != strings[-i-1]:
    ans = "No"
for i in range((len_str-1)//4):
  
  if strings[i] != strings[(len_str-1)//2-i-1]:
    ans = "No"
  
  if strings[(len_str+3)//2+i-1] != strings[-i-1]:
    ans = "No"
print(ans)

Solution (Python):
S = input()

N = len(S)
a = (N - 1) // 2
b = (N + 3) // 2

A = S[0:a]
B = S[b-1:N]
ans = 'Yes'

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

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

if A != B: ans = 'No'

print(ans)

Solution (Python):
def istrue(s):
	for a, b in zip(s, reversed(s)):
		if a != b:
			return False
	return True


s = input()
fl = (len(s)-1)/2
el = (len(s)+3)/2-1
f = s[0:int(fl)]
e = s[int(el):len(s)]

if istrue(s) is False:
	print("No")
	exit()
if istrue(f) is False:
	print("No")
	exit()
if istrue(e) is False:
	print("No")
	exit()
print("Yes")

Solution (Python):
s = input()
s_list = list(s)
n = len(s_list)
s_r = str(''.join(reversed(s_list)))
s_f = ''.join(s_list[:int((n-1)/2)])
s_b = ''.join(s_list[int((n+3)/2-1):])
if (s == s_r) and (s_f == s_b):
  print('Yes')
else:
  print('No')

Solution (Python):
S = list(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):
S=list(input())
A=list(reversed(S))
N=len(S)
S1=S[:(N)//2]
rS1=list(reversed(S1))
if S1!=rS1:
    print("No")
    exit()
S2=S[(N+1)//2:]
rS2=list(reversed(S2))
if S2!=rS2:
    print("No")
    exit()
if S!=A:
    print("No")
    exit()
print("Yes")

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

exa = S[::]
exb = S[:mojisu//2]
exc = S[(mojisu+3)//2-1::]

if exa==exa[::-1] and exb==exb[::-1] and exc==exc[::-1]:
    print('Yes')
else:
    print('No')

Solution (Python):
string_values = list(input())
size = len(string_values)
half_size = int((size - 1) / 2)
half_last_size = int((size + 3) / 2)

count = 0
is_true = True
for string_value in string_values:
    if string_value != string_values[size - count - 1]:
        is_true = False
    if count > half_size:
        break
    count += 1

count = 0
for string_value in string_values:
    if string_value != string_values[half_size - count - 1]:
        is_true = False
    if count + 1 == half_size:
        break
    count += 1

count = 0
check_count = 0
for string_value in string_values:
    if count + 1 < half_last_size:
        count += 1
        continue
    if string_value != string_values[size - check_count - 1]:
        is_true = False
    check_count += 1
    count += 1


answer = "No"
if is_true:
    answer = "Yes"
print(answer)

Solution (Python):
import copy
S = list(input())
N = len(S)
ReS = copy.copy(S)
o = 1
for i in S:
    ReS[N-o] = i
    o += 1
if S == reversed(S):
    print("Yes")
if S == ReS:
    if S[0:int((N-1)/2)] == ReS[int((N+1)/2): N]:
        if S[int((N+1)/2): N] == ReS[0:int((N-1)/2)]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
        print("No")

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

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

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

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

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

def chk2(s):
    global N
    r_idx = int((N-1)/2)
    w = s[0:r_idx]
    return str(w) == str(w[::-1])

def chk3(s):
    global N
    l_idx = int((N+3)/2)
    w = s[l_idx-1:]
    return str(w) ==  str(w[::-1])

f = False
if chk1(S):
    if chk2(S):
        if chk3(S):
            f = True
            print("Yes")

if f == False:
    print("No")

Solution (Python):
def reverse(s): 
    return s[::-1] 
  
def isPalindrome(s): 
    rev = reverse(s) 

    if (s == rev): 
        return True
    return False
s = input()
N = len(s)
ans = isPalindrome(s) & isPalindrome(s[0:int((N-1)/2)]) & isPalindrome(s[int((N+1)/2):N])
  
if ans == True: 
    print("Yes") 
else: 
    print("No")

Solution (Python):


import sys
import math
import time

import collections
from collections import deque
import queue
import copy
import bisect
import heapq


def dfs(s, prev, pre):
  val[s] += Ope[s] + prev
  for i in G[s]:
    if(i == pre):
      continue
    dfs(i, val[s], s)

def bfs(sx, sy, n):
  que = deque([[sy,sx]])
  while que:
    y,x = que.popleft()
    for i,j in D:
      if(x+i<0 or y+j<0 or x+i>W-1 or y+j>H-1):
        continue
      dist = G[y+j][x+i]
      if(G[y+j][x+i] != "X"):
        if(type(G[y+j][x+i]) is str):
          G[y+j][x+i] = G[y][x]+1
          que.append([y+j,x+i])
        elif(dist>G[y][x]+1):
          G[y+j][x+i] = G[y][x]+1
          que.append([y+j,x+i])
        

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

def ispalindrome(s):
  h = int(math.floor(len(s) / 2))
  
  hh = h+1
  if(len(s)%2==0):
    hh = h
  for a, b in zip(s[hh:], reversed(s[:h])):
    if a != b: return 0
  return 1







S = str(input())
ans = "No"
h = int(math.floor(len(S) / 2))



if(ispalindrome(S)==1):
  if(ispalindrome(S[:h])==1):
    ans = "Yes"

print(ans)

Solution (Python):
S = input()
N = len(S)
for i in range(int((N-1)/2)):
  if S[i] != S[-(i+1)]:
    print("No")
    exit()
half = S[0:int((N-1)/2)]
for i in range(int((N-1)/4)):
  if half[i] != half[-(i+1)]:
    print("No")
    exit()
print("Yes")

Solution (Python):
s = input()

answer = "Yes"

s_list = list(s)
s_list_reverse = list(reversed(s))

n = int((len(s_list)-1)/2)
m = int((len(s_list)+3)/2)

for i in range(len(s_list)):
  if s_list[i] != s_list_reverse[i]:
    answer = "No"
    break

    
s_list_1 = s_list[0:n]
s_list_1_reverse = list(reversed(s_list_1))

for i in range(len(s_list_1)):
  if s_list_1[i] != s_list_1_reverse[i]:
    answer = "No"
    break

s_list_2 = s_list[m-1:]
s_list_2_reverse = list(reversed(s_list_2))    
    
for i in range(len(s_list_2)):
  if s_list_2[i] != s_list_2_reverse[i]:
    answer = "No"
    break
    
print(answer)

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

Solution (Python):
from fractions import gcd


import heapq
import math
from collections import defaultdict, Counter, deque
from bisect import *
import itertools
import fractions
import sys
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7



def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

import random
def main():
    s = list(input())
    n = len(s)
    if n == 3:
        if s[0] == s[2]:
            print("Yes")
        else:
            print("No")
        exit()
    
    a = s[:(n - 1) // 2]
    b = s[(n + 3) // 2-1:]
    
    for i in range(len(a) // 2):
        if (a[i] != a[len(a) - 1 - i]):
            print("No")
            exit()


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

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

if __name__ == '__main__':
    main()

Solution (Python):
import sys

s = input()

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

list_l = list[:n//2]
list_r = list[(n//2)+1:]

n_l = len(list_l)
n_r = len(list_r)

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

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

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

print('Yes')

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

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

Solution (Python):
S = input()
def is_batch(s):
    return True if s==s[::-1] else False

ans = 'No'
n = len(S)
if is_batch(S):
    if is_batch(S[0:(n//2)]):
        if is_batch(S[(n+2)//2:n+1]):
            ans = 'Yes'
print(ans)

Solution (Python):
import math
s = input()
n = len(s)
x = math.floor((n-1)/2)
y = math.floor((n+3)/2)

if (s[:x] == s[y-1:]):
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()

ans = True
n = len(s)
if s != s[::-1]:
    ans = False

front = s[0:(n-1)//2]
if front != front[::-1]:
    ans = False


back = s[(n+3)//2-1:n+1]
if back != back[::-1]:
    ans = False



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

Solution (Python):


S = input()
N = len(S)


def hantei(s, n):
  flag = False
  if n % 2 == 1:
    flag = s[:n//2] == s[:n//2:-1]
  else:
    flag = s[:n//2] == s[:(n//2)-1:-1]
  if flag:
    return True
  else:
    return False

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

if hantei(S, N) and hantei(S1, len(S1)) and hantei(S2, len(S2)):
  print('Yes')
else:
  print('No')

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

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

if S1==S2 and S1[0:(n-1)//2]==S1[(n-1)//2::-1] and S2[0:(n-1)//2]==S2[(n-1)//2::-1]:
  print('Yes')
else:
  print('No')

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

Solution (Python):

s = input()
n = len(s)
s2 = s[:(n-1)//2]
s3 = s[(n+3)//2-1:]
n2 = len(s2)
n3 = len(s3)
f = True

for i in range(n//2):


    if s[i] != s[n-(i+1)]:
        f = False
        break

for i in range(n2//2):


    if s2[i] != s2[n2-(i+1)]:
        f = False
        break

for i in range(n3//2):


    if s3[i] != s3[n3-(i+1)]:
        f = False
        break




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

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


def res():
    fr=(n-1//2)//2
    
    sf=s[:(n-1)//2]
    for i,sft in enumerate(sf[:len(sf)//2]):
        if sft != sf[len(sf)-1-i]:
            return "No"
    
    sb=s[:(n+3)//2]
    for i,sbt in enumerate(sb[:len(sb)//2]):
        if sbt != sb[len(sf)-1-i]:
            return "No"
    
    for i,st in enumerate(s[:len(s)//2]):
        if st != s[len(s)-1-i]:
            return "No"
    
    return "Yes"

print(res())

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

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

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

Solution (Python):
S = input()

if (S == S[::-1]):
    if (S[0:(len(S)-1)//2] == S[0:(len(S)-1)//2][::-1]):
        if (S[(len(S)+3)//2-1:len(S)] == S[(len(S)+3)//2-1:len(S)][::-1]):
            print("Yes")
            exit()
print("No")

Solution (Python):
def main():
    S = input()
    N = len(S)
    P = S[:(N-1)//2]
    Q = S[(N+3)//2 - 1:]
    M = len(P)
    K = len(Q)
    if (S[:N//2] == S[N//2 + 1:][::-1]) and \
            (P[:M//2] == P[(M//2 + 1 if M % 2 == 1 else M//2):][::-1]) and \
            (Q[:K//2] == Q[(K//2 + 1 if K % 2 == 1 else K//2):][::-1]):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Solution (Python):
s = input()
n = len(s)
def rev(ss):
    return ss == ss[::-1]
if rev(s) and rev(s[0:(n // 2)]) and rev(s[(n // 2) + 1:]):
    print ("Yes")
else:
    print("No")

Solution (Python):

S = input()
N = len(S)


S_org = list(S)
S_org
S_org_r = reversed(S_org)
S_former = S_org[0:int((N-1)/2)]
S_former_r = reversed(S_former)
S_latter = S_org[int((N+3)/2)-1:N+1]
S_latter_r = reversed(S_latter)


S_org_str = ''.join(S_org)
S_org_r_str = ''.join(S_org_r)
S_former_str = ''.join(S_former)
S_former_r_str = ''.join(S_former_r)
S_latter_str = ''.join(S_latter)
S_latter_r_str = ''.join(S_latter_r)


if S_org_str == S_org_r_str and S_former_str == S_former_r_str  and S_latter_str == S_latter_r_str:
    print('Yes')
else:
    print("No")

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

sr = s[::-1]




n = len(s)

ans = "Yes"

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

if ans == "Yes":
  ss = s[0: int(((n-1)/2))]
  
  ssr = ss[::-1]
  ns = len(ss)
  for i in range(ns // 2 + 1):
    if ss[i] != ssr[i]:
      ans = "No"

if ans == "Yes":
  sl = s[int((n+3)/2)-1:]
  
  slr = sl[::-1]
  nsl = len(sl)
  for i in range(nsl // 2 + 1):
    if sl[i] != slr[i]:
      ans = "No"

print(ans)

Solution (Python):

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

string = input()
mid = int((len(string)-1)/2)

if check(string) and check(string[:mid]) and check(string[mid+1:]):
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()


def main(s):
    l = len(s)

    left = s[:int((l - 1) / 2)]
    right = s[int((l + 3) / 2) - 1:l]

    s_rev = ''.join(list(reversed(s)))
    left_rev = ''.join(list(reversed(left)))
    right_rev = ''.join(list(reversed(right)))

    if s == s_rev and left == left_rev and right == right_rev and ( 3 <= l <= 99 ):
        res = 'Yes'
    else:
        res = 'No'
    return res


print(main(S))

Solution (Python):
import sys
import math
def i():return int(sys.stdin.readline().replace("\n",""))
def i2():return map(int,sys.stdin.readline().replace("\n","").split())
def s():return str(sys.stdin.readline().replace("\n",""))
def l():return list(sys.stdin.readline().replace("\n",""))
def intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def lx():return list(map(lambda x:int(x)*-1,sys.stdin.readline().replace("\n","").split()))
def t():return tuple(map(int,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":pass
s = l()
a = s[:len(s)//2]
b = s[len(s)//2+1:]
print("Yes" if a == b else "No")

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

ans = "Yes"
N = len(S)

i = 0
while i < N:
  k = N - i


  if S[i] != S[k -1]:
    ans = ' No'
  i += 1

i = 0
l = (N - 1) // 2

while i < l:
  k = l -i

  if S[i] != S[k - 1]:
    ans = 'No'
  i += 1

i = (N + 3) // 2
while i < N:
  m = N - i
  if S[i] != S[m -1]:
    ans = 'No'
  i += 1

print(ans)

Solution (Python):
s = input()
if s == s[::-1]:
    flag = True
else:
    flag = False
N = len(s)
if flag:
    new = s[0:int((N-1)/2)]
    if new == new[::-1]:
        flag = True
    else: flag = False

if flag:
    new = s[int((N+2)/2):N]
    if new == new[::-1]:
        flag = True
    else:
        flag = False

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

Solution (Python):
s = input()

flag = 0
slen = len(s)

if s == s[::-1]:
  flag += 1
  
s1 = s[::(slen-1)//2]
if s1 == s1[::-1]:
  flag += 1
  
s2 = s[(slen+3)//2-1:]
if s2 == s2[::-1]:
  flag += 1

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

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

  return flag
        
S = input()
N = len(S)

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

if kaibunCheck(S) == True and kaibunCheck(S1) == True and kaibunCheck(S2) == True:
  print("Yes")
else:
  print("No")

Solution (Python):
s = str(input())
n = len(s)
num = (n-1)//2
a = 1

if num % 2 == 0:
    num_e = num // 2 
    for i in range(num_e):
        if (s[i] != s[num-i-1]) or (s[i] != s[num + i + 1]) or (s[i] != s[n-i-1]):
            a = 0
            break

else:
    num_o = num // 2
    if s[num_o] != s[num+num_o+1]:
        a = 0
    else:
        for i in range(num_o):
            if s[i] != s[num-i-1] or s[i] != s[num + i + 1] or s[i] != s[n-i-1]:
                a = 0
                break
if a:
    print("Yes")
else:
    print("No")

Solution (Python):
S = list(map(str, input()))
S_reverse = list(reversed(S))
index_1 = 0
index_2 = 0
index_3 = 0

for i in range(0, len(S)):
    if S[i] != S_reverse[i]:
        index_1 = 1
        break

left = int((len(S) - 1) / 2)
S_left = S[0:left]
S_left_reverse = list(reversed(S_left))
right = int((len(S) + 3) / 2) - 1
S_right = S[right:len(S)]
S_right_reverse = list(reversed(S_right))


for i in range(0, len(S_left)):
    if S_left[i] != S_left_reverse[i]:
        index_2 = 1
        break

for i in range(0, len(S_right)):
    if S_right[i] != S_right_reverse[i]:
        index_3 = 1
        break

index = index_1 + index_2 + index_3
if index == 0:
    print('Yes')
else:
    print('No')

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

if s == s[::-1]:
  
  p = int((n-1)/2)
  f = s[:p]
  if f == f[::-1]:
    
    q = int((n+3)/2)
    l = s[q-1:]
    if l == l[::-1]:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")

Solution (Python):
def main():

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

    str= input()
    n=len(str)
    N=int((n-1)/2)

    s_first, s_second, s_last = str[:N], str[N:N+1], str[N+1:]
    
    if ispalindrome(str) and (n+1)%2==0:
        if ispalindrome(s_first) and ispalindrome(s_last):
            print("Yes")
            return
        else:
            print("No")
            return
    else:
        print("No")
        return
main()

Solution (Python):
S=input()
N=len(S)
S_r=S[::-1]
S2=S[:int((N-1)/2)]
S2_r=S2[::-1]
S3=S[int((N+3)/2)-1:]
S3_r=S3[::-1]
x=0
a=0
b=0
c=0
for i in range(int((N-1)/2)):
    if S[i]==S_r[i]:
        a+=1
if a==int((N-1)/2):
    x+=1
    for i in range(len(S2)):
        if S2[i]==S2_r[i]:
            b+=1
if b==len(S2):
    x+=1
    for i in range(len(S3)):
        if S3[i]==S3_r[i]:
            c+=1
if c==len(S3):
    x+=1

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

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

if s!=a:
    print('No')
    exit()

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

if b!=c:
    print('No')
    exit()

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

if d!=e:
    print('No')
    exit()

print('Yes')

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

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

if(ispalindrome(s)*ispalindrome(s1)*ispalindrome(s2) == 1):
  print('Yes')
else:
  print('No')

Solution (Python):
S=input()

SS=S[::-1]



if(S!=SS):
    print("No")
    exit()

Slen=int((len(S)-1)/2)
S1=S[:Slen]
SS1=S1[::-1]

if(S1!=SS1):
    print("No")
    exit()
    
Slen=int((len(S)+3)/2)
S1=S[Slen-1:]
SS1=S1[::-1]

if(S1!=SS1):
    print("No")
    exit()
print("Yes")

Solution (Python):

S = input()


def check(s, i, j):
    if (j-i)%2 == 1:
        l = (j-i-1)//2
        for s, t in zip(s[i:l], reversed(s[l+1:j])):
            if s != t:
                return False
    else:
        l = (j-i)//2
        for s, t in zip(s[i:l], reversed(s[l:j])):
            if s != t:
                return False
    return True        

result = check(S, 0, len(S))
result &= check(S, 0, (len(S)-1)//2)
result &= check(S, (len(S)+3)//2-1, len(S))


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

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

Sr = S[::-1]

S2 = S[:int((N-1)/2)]
S2r =S2[::-1]
S3 = S[int((N+3)/2)-1:N]
S3r =S3[::-1]



if S ==Sr and S2== S2r and S3==S3r:
    print('Yes')
else:
    print('No')

Solution (Python):

S = str(input())
N = int(len(S))

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

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