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 math
S = input()
N_s = int((len(S)-1)/2)-1
N_l = int((len(S)+3)/2)

num = N_s
flg = True
num_std = len(S)-1
for k in range(len(S)):
    if S[k] != S[num_std] and k < num_std:
        flg = False
        print("No")
        break
    if k > num_std:
        break
    num_std -= 1
if flg and len(S) == 3:
    flg = False
    print("Yes")
if flg:
    for i in  range(N_s):
        if not flg:
            break
        if(S[i] != S[num]):
            if(num > i):
                print("No")
                break
        if(num == i or num < i):
            num2 = len(S)-1
            for j in range(N_l-1,len(S),1):
                if(S[j] != S[num2]):
                    if(num2 > j):
                        print("No")
                        break
                if(num2 == j or num < j):
                    print("Yes")
                    flg = False
                    break
                num2 -= 1
        num -= 1

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

s_list = list(s)
r_list = list(s)
r_list.reverse()

first_s_list = s_list[0:(n - 1) // 2]
first_r_list = list(reversed(first_s_list))

last_s_list = s_list[(n - 1) // 2 + 1:n]
last_r_list = list(reversed(last_s_list))

if s_list == r_list and first_s_list == first_r_list and last_s_list == last_r_list:
    print('Yes')
else:
    print('No')

Solution (Python):
S = input()
N = len(S)
i = int((N - 1) / 2)
j = int((N + 3) / 2)
T = S[0:i]
U = S[j-1:N]

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

Solution (Python):
import sys

s = input()
n = len(s)

s_2 = s[0:(n-1)//2]
s_3 = s[(n+3)//2:n]

for i, k in enumerate(s):
    if k != s[(n-1) - i]:
        print('No')
        sys.exit()

for i, k in enumerate(s_2):
    if k != s[(len(s_2)-1) - i]:
        print('No')
        sys.exit()

for i, k in enumerate(s_3):
    if k != s[(len(s_3)-1) - i]:
        print('No')
        sys.exit()


print('Yes')

Solution (Python):
s = list(input())
judge = 0
n = len(s)
if s != s[-1::-1]:
    judge +=1

if s[0:(n-1)//2] != s[(n-3)//2::-1]:
    judge +=1

if s[(n+1)//2:n] != s[n-1:(n-1)//2:-1]:
    judge +=1

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

Solution (Python):
S = list(input())
N = len(S)
hn = int((N-1)/2)
for i in range(hn):
  if S[i] != S[N-1-i]:
    print('No')
    exit()
for i in range(hn//2):
  if S[i] != S[hn-1-i]:
    print('No')
    exit()
for i in range(hn//2):
  if S[hn+1+i] != S[N-1-i]:
    print('No')
    exit()
x = hn//2
if hn % 2 == 1:
  if S[x] != S[N-1-x]:
    print('No')
    exit()
print('Yes')

Solution (Python):
s = input()
s1 = s[::-1];n = len(s)
f = 0

if s == s1:
    s2 = s[:(n-1)//2]
    
    if s2 == s2[::-1]:
        
        s3 = s[(n+3)//2-1:n]
        
        if s3 == s3[::-1]:
            f = 1
        
        else:
            f = 0
    
    else:
        f = 0
        
else:
    f = 0
    
if f == 0:
    print('No')
else:
    print('Yes')

Solution (Python):
s = input()
n = len(s)
s1 = s[0:len(s)//2]
s2 = s[len(s)//2+1:len(s)]

def reverse(s): 
    return s[::-1]

def isPalindrome(s): 
    rev = reverse(s) 
  
    if (s == rev): 
        return True
    return False

if isPalindrome(s):
    if n % 2 == 0:
        print("No")
    elif isPalindrome(s1) and isPalindrome(s2):
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

reS = list(reversed(S))

cnt = 0
cntA = 0
cntB = 0

for (i, j) in zip(S, reS):
    if i == j:
        cnt += 1
    else:
        print('No')
        break
    
if cnt == len(S):
    N = len(S)
    listA = []
    listB = []

    for i in range(0, (N-1)//2):
        listA.append(S[i])
    for j in range((N+3)//2 - 1, N):
        listB.append(S[j])

    reA = list(reversed(listA))
    reB = list(reversed(listB))

    for (i, j) in zip(listA, reA):
        if i == j:
            cntA += 1
        else:
            pass

    for (i, j) in zip(listB, reB):
        if i == j:
            cntB += 1
        else:
            pass

    if cntA == len(listA) and cntB == len(listB):
        print('Yes')
    else:
        print('No')

Solution (Python):

import sys

s = input()
if s != s[::-1]:
    print("No")
    sys.exit()
index = (int)(len(s) - 1) // 2
s1 = s[0:index]
if s1 != s1[::-1]:
    print("No")
    sys.exit()
index1 = (len(s)+3) // 2
s2 = s[index1:-1]
if s2 != s2[::-1]:
    print("No")
    sys.exit()
print("Yes")

Solution (Python):
S = list(input())
N = len(S)
ans = "Yes"

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

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

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

print(ans)

Solution (Python):
S = input()
N = len(S)
rev = S[::-1]
a = int((N-1)/2)
b = int((N+3)/2)

fir = S[0:a]
sec = S[b-1:N]

if (rev == S) and(fir == fir[::-1]) and (sec == sec[::-1]):
  ans = 'Yes'
else :
  ans = 'No'
  
print(ans)

Solution (Python):
s = str(input())
s_l = []
for i in range(len(s)):
    s_l.append(s[i])

n = len(s) - 1

m = n // 2 - 1

Tsuyoi = True
i = 0

while i <= m // 2:
    if s_l[i] != s_l[m - i]:
        Tsuyoi = False
        break
    if s_l[m + i + 2] != s_l[n - i]:
        Tsuyoi = False
        break
    if s_l[i] != s_l[n-i]:
        Tsuyoi = False
        break
    i += 1

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

Solution (Python):
def palindrom(st):
    return st == st[::-1]
import math
s = input()
l = len(s)
print("Yes" if palindrom(s) and palindrom(s[:(l-1)//2]) and palindrom(s[(l+2)//2:]) else "No")

Solution (Python):
S=list(input())
L=len(S)
for i in range(L):
    if S[i] != S[L-i-1] :
        print("No")
        exit()
for n in range(int((L-1)/2)):
    if  S[n] != S [int((L-1)/2)-n-1]:
        print("No")
        exit()
print("Yes")

Solution (Python):
import sys

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

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

S1=list(S[:N1])
S2=list(S[N2:])


S3=list(reversed(S1))
S4=list(reversed(S2))
Sr=list(reversed(S))

if S==Sr:
    if S1==S3:
        if S2==S4:
            print("Yes")
            sys.exit()
print("No")

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

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

check = palindrome(s) + palindrome(a) + palindrome(b)

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

Solution (Python):
from math import floor, ceil

s = input()

def isKaibun(str1):
    
    halflen = floor(len(str1) / 2)
    backlen = ceil(len(str1) / 2)
    back = ''.join(reversed(str1[backlen:]))
    if str1[:halflen] == back:
        return True
    else:
        return False

if isKaibun(s):
    front = (len(s)-1) // 2
    fs = s[:front]
    if isKaibun(fs):
        rear = (len(s)+3) // 2
        rs = s[rear-1:]
        if isKaibun(rs):
            print('Yes')
            exit()

print('No')

Solution (Python):
S = input()

N = len(S)

f = (N - 1) // 2
s = (N + 1) // 2

if S == S[::-1]:
    flg = True
else:
    flg = False

if flg:
    if S[0:f] == S[s:N]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Solution (Python):


s = input()
n = len(s)
h = int((n-1)/2)
Ans = 'No'
sl = s[0:h]
slr = sl[::-1]
sr = s[-1: -h - 1:-1]
if sl == sr and sl == slr:
  Ans = 'Yes'
print(Ans)

Solution (Python):
S = str(input())
N = len(S)
a = (N-1)//2
b = (N+3)//2
c = a//2
head = S[0:a]
tail = S[b-1:N]
ans = 'Yes'

for i in range(a):
  if S[i] != S[N-1-i]:
    ans = 'No'
for i in range(c):
  if head[i] != head[a-1-i]:
    ans = 'No'
for i in range(c):
  if tail[i] != tail[a-1-i]:
    ans = 'No'

print(ans)

Solution (Python):
given = input()
n = len(given)
left, rite = given[:n//2], given[n//2+1:]
print("Yes" if left == left[::-1] and rite == rite[::-1] and given==given[::-1] else "No")

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


def check(s):
    mid = len(s) // 2
    if len(s) % 2 != 0:
        left = s[:mid]
        right = s[mid+1:]
    else:
        left = s[:mid]
        right = s[mid:]
    if left == right[::-1]:
        return True
    else:
        return False

if check(s) and check(r) and check(l):
    print("Yes")
else:
    print("No")

Solution (Python):
S=input()
ans=1

for i in range((len(S)-1)//2):
    
    if S[i]==S[len(S)-1-i]:
        ans*=1
    else:
        ans*=2

for j in range((len(S)-1)//2):
    
    if S[j]==S[(len(S)-1)//2-j-1]:
        ans*=1
    else:
        ans*=3

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

Solution (Python):
s=list(input())
n=len(s)
t=s[:int((n-1)/2)]
u=s[int((n+3)/2)-1:]
a=0
if s==s[::-1]:
  if t==t[::-1]:
    if u==u[::-1]:
      a=1
if a==0:
  print('No')
elif a==1:
  print('Yes')

Solution (Python):
s=list(input())
n=len(s)
t=[]
for i in (reversed(s)):
    t.append(i)
if s==s[::-1] and s[:int((n-1)/2)]==t[-(int((n-1)/2)):] and s[int((n+3)/2-1):]==t[:int((n+3)/2-2)]:
    print("Yes")
else:
    print("No")

Solution (Python):
inp = input()
part1 = inp[0:int((len(inp)-1)/2)]
part2 = inp[int((len(inp)+1)/2):]


def isParin(S):
    n = len(S)
    flg = 0
    for i in range(int(n/2)):
        if S[i] != S[n-1-i]:
            flg += 1
    if flg == 0:
        return True
    else:
        return False


if isParin(inp):
    if part1 == part2:
        print('Yes')
    else:
        print('No')
else:
    print('No')

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

revS = list(reversed(L))

preS = L[:int((N - 1) / 2)]
revPreS = list(reversed(preS))

backS = L[int((N + 2) / 2):]
revBackS = list(reversed(backS))

if L != revS:
    print("No")
elif preS != revPreS:
    print("No")
elif backS != revBackS:
    print("No")
else:
    print("Yes")

Solution (Python):
s = input()
ll = len(s)
l = ll // 2

ans = True
t = l
if len(s) % 2 != 0:
    t = l - 1

for i in range(0, t):
    if s[i] != s[t-i]:
        ans = False

t = l
if len(s) % 2 != 0:
    t = l + 1

ll -= 1
c = 0
for i in range(t, ll):
    if s[i] != s[ll-c]:
        ans = False
    c += 1

if s[:t-1] != s[t:]:
    ans = False

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

Solution (Python):
s=input()

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

n = len(s)
n%2 == 1
ed=int((n-1)/2)
st=int((n+3)/2)

s2= s[0:ed]
s3= s[st:(-1)]


if is_kaibun(s) == False:
    print("No")
    exit()

elif is_kaibun(s)==True:
    if is_kaibun(s2)==True:
        if is_kaibun(s3)==True:
            print("Yes")
            exit()

print("No")

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

S = input()

length = len(S)

mini_length = length//2

if mini_length%2 != 0:
    left_center = mini_length//2
    right_center = mini_length + left_center + 1
    left_left = S[:left_center]
    left_right = S[left_center+1:mini_length]
    right_left = S[mini_length+1:right_center]
    right_right = S[right_center+1:length]
    left = S[:mini_length]
    right = S[mini_length+1:length]

    
    
    
    
    if (ispalindrome(left)==1) and (ispalindrome(right)==1) and(ispalindrome(S)==1):
        print('Yes')
    else:
        print('No')
else:
    left_center = mini_length//2
    right_center = mini_length + left_center + 1
    left_left = S[:left_center]
    left_right = S[left_center:mini_length]
    right_left = S[mini_length+1:right_center]
    right_right = S[right_center:length]
    left = S[:mini_length]
    right = S[mini_length+1:length]
    if (ispalindrome(left)==1) and (ispalindrome(right)==1) and (ispalindrome(S)==1):
        print('Yes')
    else:
        print('No')

Solution (Python):


import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def MI() : return map(int, input().split())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def chkprint(*args) : names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}; print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

S = input()

N = len(S)


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

Solution (Python):

s = input().strip()

def is_kaibun(ss):
    if len(ss) % 2:
        return ss[: len(ss) // 2] == ss[len(ss) // 2 + 1:][:: -1]
    else:
        return ss[: len(ss) // 2] == ss[len(ss) // 2:][:: -1]

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

Solution (Python):
li=list(input())
N=int(len(li))
liR=reversed(li)
liR=list(liR)
A=False
B=False
C=False
if li==liR:
    A=True

liF=li[0:round((N-1)/2)]
liFR=reversed(liF)
liFR=list(liFR)
if liF==liFR:
    B=True

liB=li[round((N+1)/2):N]
liBR=reversed(liB)
liBR=list(liBR)
if liB==liBR:
    C=True

if A==True and B==True and C==True:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
n = len(s)
left = ((n - 1) // 2) - 1
s1 = s[0 : left + 1]
right = ((n + 3) // 2) - 1
s2 = s[right : ]

s1rev = s1[::-1]
s2rev = s2[::-1]
srev = s[::-1]

if ((s1 == s1rev) and (s2 == s2rev) and s == srev):
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
n = len(s)
ans = 'No'
if s == list(reversed(s)):
    if s[:int((n-1)/2)] == list(reversed(s[:int((n-1)/2)])):
        ans = 'Yes'
print(ans)

Solution (Python):

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


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


if is_kaibun(str):
    before = int((n - 1) / 2)
    later = int((n + 3) / 2)
    str_before = str[0:before]
    if is_kaibun(str_before):
        str_later = str[int(n / 2 + 1):later]
        if is_kaibun(str_later):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Solution (Python):

import sys
S = input()
S_list = list(S)
tmp = S_list.copy()
N = len(S)
if N % 2 == 0:
  print("No")
  sys.exit()
else: 
  S_list.reverse()
  if S_list == tmp:
    tmp_2 = int((len(tmp)-1) / 2)
    tmp_2_list = tmp[:tmp_2]
    t2=tmp_2_list.copy()
    
    tmp_3 = int((len(tmp)+3) / 2)
    tmp_3_list = tmp[tmp_3-1:]
    t3 = tmp_3_list.copy()
    
    tmp_2_list.reverse()
    tmp_3_list.reverse()
    if tmp_2_list == t2 and tmp_3_list == t3:
      print("Yes")
      sys.exit()
    else:
      print("No")
      sys.exit()
  else:
    print("No")
    sys.exit()

Solution (Python):
S = input()
s = list(S)
def is_strong_palindrome(strings):
    a = len(strings)
    b = (len(strings) - 1) // 2
    c = (len(strings) + 3) // 2
    for h in range(a // 2):
        if strings[h] != strings[-h-1]:
            return False
    for i in range(b // 2):
        if strings[i] != strings[(b-i-1)]:
            return False
    for j in range(b // 2):
        if strings[c+j-1] != strings[a-j-1]:
            return False
    return True
if is_strong_palindrome(s) == True:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys

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

S=str(input())
len_s = len(S)
len_h = int((len_s-1)/2)


if ispalindrome(S)==0:
	print('No')
	sys.exit()
else:
	if ispalindrome(S[:len_h])==0:
		print('No')
		sys.exit()
	elif ispalindrome(S[-1:len_h])==0:
		print('No')
		sys.exit()
print('Yes')

Solution (Python):



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

    return True


S = input()
N = len(S)

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

Solution (Python):
def ok(str_):
    len_=len(str_)
    for i in range(len_):
        if str_[i] != str_[len_-i-1]:
            return False

    return True

s=input()
len_=len(s)
if not ok(s):
    print('No')
elif not ok(s[:len_//2]):
    print('No')
elif not ok(s[len_//2+1:]):
    print('No')
else:
    print('Yes')

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

Solution (Python):
s = raw_input()
n = len(s)
k1 = s[:(n-1)/2]
k2 = k1[::-1]
l1 = s[((n+3)/2)-1:]
l2 = l1[::-1]
if s == s[::-1] and k1 == k2 and l1 == l2:
    print 'Yes'
else:
    print 'No'

Solution (Python):

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

n = (N-1)//2


Sa = S[:n]

Sb = S[n+1:]



def Pal(x):
    flag = 1
    Lx = len(x)
    if Lx > 1:
        for i in range(Lx//2):
            
            
            
            if x[i] != x[Lx-i-1]:
                flag = 0
    
    return flag

if Pal(S)*Pal(Sa)*Pal(Sb) == 1:
    print('Yes')
else:
    print('No')

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

def inv(l_s):
    l_s_res = []
    for i in l_s[::-1]:
        l_s_res.append(i)
    return l_s_res

def repeat_str(l_s):
    return l_s == inv(l_s)

def first_rep(l_s):
    return repeat_str(l_s)

def second_rep(l_s):
    N = len(l_s)
    l_s_tmp = l_s[:int((N-1)/2)]
    return repeat_str(l_s_tmp)

def third_rep(l_s):
    N = len(l_s)
    l_s_tmp = l_s[int((N+3)/2-1):]
    return repeat_str(l_s_tmp)

if first_rep(l_s) == True and second_rep(l_s) == True and third_rep(l_s) == True:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
n = len(s)
m = (n-1)//2
l = (n+3)//2
s_1 = s[0:m]
s_2 = s[l-1:n+1]
ans1 = s == s[::-1]
ans2 = s_1 == s_1[::-1]
ans3 = s_2 == s_2[::-1]
if ans1 and ans2 and ans3:
    print('Yes')
else:
	print('No')

Solution (Python):
import sys


from math import factorial

def main():
    s = input()
    sl = len(s)
    s_r = s[(sl//2)+1:]
    if s[:(sl//2)] != s_r[::-1]:
        print('No')
        exit()
    s1 = s[:((sl-1)//2)]
    s1l = len(s1)
    s1_f = s1[:(s1l//2)]
    if s1l %2 ==1:
        s1l += 1
    s1_r = s1[(s1l//2):]
    if s1_f != s1_r[::-1]:
        print('No')
        exit()

    s2 = s[((sl+3)//2)-1:]
    s1l = len(s1)
    s2_f = s2[:(s1l//2)]
    if s1l %2 ==1:
        s1l += 1
    s2_r = s2[(s1l//2):]
    if s2_f != s2_r[::-1]:
        print('No')
        exit()
    print('Yes')

if __name__ == '__main__':
    main()

Solution (Python):
from math import floor as f
S = list(input())
N = len(S)

hantei = True
for c in range(f(N / 2)):
    if S[c] == S[-1 * c - 1]:
        pass
    else:
        hantei = False
        break

for c in range(f((N - 1) / 4)):
    if S[c] == S[-1 * c + -1 * f(N / 2) - 2]:
        pass
    else:
        hantei = False
        break

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

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

all_error = 0
for i in range(0, N-1):
  if S[i] == S[N-1-i]:
    pass
  else:
    all_error = 1

before_error = 0
for j in range(0, int((N-1-1)/2)):
  if S[j] == S[int((N-1-1)/2)-j]:
    pass
  else:
    before_error = 1

after_error = 0
for k in range(0, (N-1) - (int((N+3)/2)-1) - 1):
  if S[int((N+3)/2)-1+k] == S[N-1-k]:
    pass
  else:
    after_error = 1

if int(all_error) + int(before_error) + int(after_error) == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
import sys

S = list(input())
Sr = S[::-1]

if S != Sr:
    print("No")
    sys.exit()

N = len(S)
C1 = int(((N - 1) / 2))
C2 = int(((N + 3) / 2) - 1)

C1Str = S[0:C1]
C2Str = S[C2:N]

if C1Str != C1Str[::-1]:
    print("No")
    sys.exit()

if C2Str != C2Str[::-1]:
    print("No")
    sys.exit()

print("Yes")

Solution (Python):
S=input()
Count=0
N=len(S)
new_S= S[::-1]
if S[0:(N-1)//2]==new_S[(N+3)//2-1:N]:
  Count=0
else:
  Count=1

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

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

ans = 0

def kaibun(tex):
  n = len(tex)
  before = tex[0:int((n-1)/2)]
  after = tex[int((n+3)/2-1):]
  if before == before[::-1] and after == after[::-1]:
    return 1
  else:
    return 0

ans += kaibun(s)

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

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

sa = s[0:(n-1)//2]
sb = s[(n+1)//2:n]

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

if palindrome(s) and palindrome(sa) and palindrome(sb):
    print("Yes")
else:
    print("No")

Solution (Python):
import math
import fractions

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)

    
    return divisors

def ValueToBits(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def BitsToValue(arr):
    n = len(arr)
    ans = 0
    for i in range(n):
        ans+= arr[i] * 2**i
    return ans

def ValueToArray10(x, digit):
    ans = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        ans[digit-i-1] = now%10
        now = now //10
    return ans
'''
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 2
N = 10 ** 6 + 2
fact = [1, 1]  
factinv = [1, 1]  
inv = [0, 1]  

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)
'''




s = input()
n = len(s)

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

Solution (Python):
a     = list(input())
a_re  = list(reversed(a))

if a == a_re:
  if len(a) % 2 == 0:
    b = a[0:len(a)/2]
    b_re = a[0:len(a)/2]
    b_re = list(reversed(b_re))
    if b == b_re:
      print('Yes')
    else:
      print('No')
  else:
    b = a[0:int(len(a)/2)]
    b_re = a[0:int(len(a)/2)]
    b_re = list(reversed(b_re))
    if b == b_re:
      print('Yes')
    else:
      print('No')
else:
  print('No')

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

N_half_S = len(S) // 2
half_S = S[0:N_half_S]
convS = S[::-1]
convS = convS[0:N_half_S]

N_quoter_S = N_half_S // 2
quoter_S = half_S[0:N_quoter_S]
conv_quoter_S = half_S[::-1]
conv_quoter_S = conv_quoter_S[0:N_quoter_S]

if half_S == convS and quoter_S == conv_quoter_S :
  print("Yes")
else :
  print("No")

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

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

pre = list(s[0:int((n-1)/2)])
rear = list(s[int((n+3)/2-1):int(n)])

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

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

Solution (Python):


s = input()
s1 = s[::-1]
l=len(s)

check = 0
if(s==s1):
    if(s[0:int((l-1)/2)] == s1[int((l+3)/2)-1:l]):
        if(s[int((l+3)/2)-1:l] == s1[0:int((l-1)/2)]):
            print("Yes")
            check =1
if(check ==0):
    print("No")

Solution (Python):
s = list(input())
def kaibun(a):
    l = len(a)
    
    
    for _ in range(l//2):
    
        if a[_] != a[l - _ - 1]:
            return False
    return True
    

if kaibun(s):
    ss = list()
    for __ in range(len(s)//2):
        ss += s[__]

    if kaibun(ss):
        print("Yes")
        exit()
print("No")

Solution (Python):
S=str(input())
N=int(len(S))
a=S[:int((N-1)/2)]
b=S[int((N+1)/2):]
ans='No'
if a==b[::-1]:
  if a==a[::-1] and b==b[::-1]:
    ans='Yes'
print(ans)

Solution (Python):
def check(s):
	l = len(s)
	c = 1

	if l != 1:

		if l % 2 == 1:
			l -= 1

		for i in range(int(l/2)):
			if s[i] != s[0-1-i]:
				c = 0

	return c

if __name__ == '__main__':
	S = input()
	LEN = len(S)
	l = int((LEN-1)/2)

	r = l+1
	s1 = S[0:l]
	s2 = S[r:LEN]

	c = check(s1) * check(s2) * check(S)

	if c == 1:
		print('Yes')
	else:
		print('No')

Solution (Python):


S = input()


N = len(S)


def judge(N, S):
    
    
    
    if N % 2 == 0:
        fr = S[:N // 2]
        rev2 = S[(N+2) // 2 - 1:]
        rev2 = rev2[::-1]
        
        
    else:
        fr = S[:(N-1) // 2]
        rev2 = S[(N+3) // 2 - 1:]
        rev2 = rev2[::-1]
        
        
        
    if fr == rev2:
        flg = True
    else:
        flg = False

    return flg

b_S = S[:(N-1) // 2]
a_S = S[(N+3) // 2 - 1:]
rev = a_S[::-1]




if b_S == rev:
    if judge(len(b_S), b_S) == True and judge(len(a_S), a_S) == True:
        print("Yes")
    else:
        print("No")
    exit()
else:
    print("No")

Solution (Python):
S = input()
if len(S)%2!=0:
    t = S[(len(S)-1)//2:(len(S)+2)//2]
    n_s = S.replace(t, "")
    L,R = n_s[:len(n_s)//2],n_s[len(n_s)//2:]
    if L == R: print ("Yes")
    else: print ("No")
else: 
    L,R = S[:len(S)//2],S[len(S)//2:]
    if L == R: print ("Yes")
    else: print ("No")

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

Solution (Python):
sentence = input()

sentence_1 = sentence[0:int(((len(sentence)-1)/2))]
sentence_2 = sentence[int(((len(sentence)+3)/2)-1): ]
ans = "Yes"

def kaibun(S):
    count = 0
    for i in range(0,int(len(S)/2)):
        if S[i] == S[-i-1]:
            count += 1
    if int(count) != int(len(S)/2):
        global ans
        ans = "No"

kaibun(sentence)
kaibun(sentence_1)
kaibun(sentence_2)

print(ans)

Solution (Python):
s = input()
s_len = len(s)
sa_len = int((s_len-1)/2)
sk_len = int((s_len + 3)/2)

ans = 'No'
if s == s[::-1]:
  szen = s[:sa_len]
  if szen == szen[::-1]:
    skou = s[sk_len-1:]
    if skou == skou[::-1]:
      ans = 'Yes'

print(ans)

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



s = input()
n = len(s)

helfCount = math.floor(n / 2)
helfHelfCount = math.floor(helfCount / 2)

ans = "Yes"

for x in range(0, helfCount):
    if s[x] != s[n - x - 1] or (x < helfHelfCount and s[x] != s[helfCount - x - 1]) :
        ans = "No"
        break

print(ans)

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


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

if kaibun(S) == True and kaibun(S[0:round((N-1)/2)]) == True and kaibun(S[round((N+1)/2):N])==True:
    print('Yes')
else:
    print('No')

Solution (Python):
s1 = str(input())
s2 = ''
for i in range(len(s1)):
    s2 += s1[- i - 1]
if s1 != s2:
    print('No')
    exit()

t1 = s1[0 : ((len(s1)) - 1) // 2]
t2 = ''
for i in range(len(t1)):
    t2 += t1[- i - 1]
if t1 != t2:
    print('No')
    exit() 

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

Solution (Python):
S = input()

N = len(S)
first = (N-1) // 2
second = (N+3) // 2

ans = 'Yes'
for i in range(first):
  
  if not(S[i] == S[first-1-i]):
    ans = 'No'
for i in range(second -1, N):
  
  
  if not(S[i] == S[N-1 - (i - (second - 1))]):
    ans = 'No'
for i in range(N):
  
  if not(S[i] == S[N-1-i]):
    ans ='No'
print(ans)

Solution (Python):
word = input()

n = len(word)

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

word2 = word[:a]
word3 = word[b-1:]

def kai1():
    for i in range(a):
        if(word[i] != word[-1*(i+1)]):
            return False
    return True
def kai2():
    wl = len(word2)
    if(wl % 2 == 0):
        wl = wl//2
    else:
        wl = (wl-1)//2
    for i in range(wl):
        if(word2[i] != word2[-1*(i+1)]):
            return False
    return True
def kai3():

    wl = len(word3)
    if(wl % 2 == 0):
        wl = wl//2
    else:
        wl = (wl-1)//2
    for i in range(wl):
        if(word3[i] != word3[(-1*(i+1))]):
            return False
    return True

if(kai1() and kai2() and kai3()):
    print("Yes")
else:
    print("No")

Solution (Python):
def main():
    s = str(input())
    n = len(s)
    
    
    if not is_kai(s):
        print('No')
        return

    partA = s[:int(((n-1)/2))]
    if not is_kai(partA):
        print('No')
        return
    
    partB = s[:int((n+1)/2)-1:-1]
    if not is_kai(partB):
        print('No')
        return
    
    print('Yes')
    return

def is_kai(word):
    n = len(word)
    if not n % 2 == 0:
        pa = word[:int((n-1)/2)]
        pb = word[:int((n+1)/2)-1:-1]
        return pa == pb
    else:
        pa = word[:int(n/2)]
        pb = word[:int(n/2)-1:-1]
        return pa == pb
    

if __name__ == '__main__':
    main()

Solution (Python):
S = input()

N = len(S)

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

s1 = S[:a+1]
s2 = S[b:]

if S==S[::-1] and s1==s1[::-1] and s2==s2[::-1]:
    print('Yes')

else:
    print('No')

Solution (Python):
S = list(str(input()))
N = len(S)
revS = S[::-1]

num1 = int((N-1)/2)
num2 = int((N+3)/2)

strN = S[1:num1]
endN = S[num2:N]

if S == revS and strN == endN:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()

def is_palindrome(a):
    n = len(a)
    i = 0
    while 2 * i < n:
        if s[i] != s[n - i - 1]:
            return False
        i += 1
    return True

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

Solution (Python):
def ABC159B(a):
    mae = [i for i in a][:(len(a)//2)]
    ushiro = [i for i in a][(-1*(-len(a)//2)):]
    if mae == ushiro[::-1]:
        return True
    else:
        return False


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

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


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