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):
s = list(input())
n = len(s)
flag = 1
c = int((n - 1) / 2)

for i in range(c):
    if s[i] != s[n - 1 - i]:
        flag = 0
        break

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

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

Solution (Python):
import math

S=str(input())
N=len(S)
M=(N-1)//2

T=str()
U=str()

for i in range(M):
    T+=S[i]

for j in range(M+1,N):
    U+=S[j]

def check(letter):
    length=len(letter)
    number=math.floor(length)-1
    answer=1
    for x in range(number):
        if letter[x]!=letter[length-1-x]:
            answer=0
    return answer

Ans=min(check(S),check(T),check(U))

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

Solution (Python):
from copy import deepcopy

S = input()
N = len(S)
two = deepcopy(S[:int((N-1)/2):1])
three = deepcopy(S[int((N+3)/2)-1:N:1])

if S == S[::-1] and two == two[::-1] and three == three[::-1]:
  print("Yes")
  exit()
print("No")

Solution (Python):
S = list(str(input()))
N = len(S)
if ((N-1)//2)%2:
  n = (N-1)//2
  e = (n-1)//2
  s = (n+3)//2-1
else:
  n = N//2
  e = n//2
  s = n//2

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

Solution (Python):
def B159():
    S = list(input())
    N = len(S)
    A = ""
    B = ""
    for i in range(0, int((N-1)/2)):
        A += S[i]
    for i in range(int((N+3)/2) - 1, N):
        B += S[i]

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


if __name__ == "__main__":
    B159()

Solution (Python):
s = input()




ans = 'Yes'

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


if ans == 'Yes':
	a = s[:int((len(s)-1)/2)]
	n = len(a)
	for i in range(int(n/2)):
		if a[i] != a[-(i+1)]:
			ans = 'No'
			break

print(ans)

Solution (Python):
def so():
    s=input()
    if s==s[::-1]:
        a=s[0:int((len(s)-1)/2)]
        if a==a[::-1]:
            b=s[int((len(s)+3)/2-1):]
            if b==b[::-1]:
                return "Yes"
    return "No"
print(so())

Solution (Python):
S = input()
a = 0
for i in range(len(S)):
    if S[i] == S[len(S)-i-1]:
        a += 1

b = 0
x = int((len(S)-1)/2)
for j in range(x):
    if S[j] == S[x -1 -j]:
        b += 1

c = 0
y = int((len(S)+3)/2)
for k in range(y-1,len(S)):
    if S[k] == S[y-k-2]:
        c += 1

if a == len(S):
    if b == x:
        if c == len(S) - y + 1:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Solution (Python):


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

S = input()
N = len(S)


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

Solution (Python):
s = input()

n = len(s)
s1=s[0:int(n/2)]
s2=s[int((n+2)/2):]

t = s[::-1]
t1=s1[::-1]
t2=s2[::-1]

if s==t and s1==t1 and s2==t2:
	print('Yes')
else: 
	print('No')

Solution (Python):
s = input()
n = len(s)
if n == 3:
    print("Yes")
elif (n//2)%2 == 0:
    l, r = s[:(n-1)//2], s[(n+1)//2:]
    m = len(l)
    ll, lr = l[:(m)//2], l[(m)//2:]
    rl, rr = l[:(m)//2], l[(m)//2:]
    if ll == lr[::-1] and rl == rr[::-1] and l == r:
        print("Yes")
    else:
        print("No")
else:
    l, r = s[:(n-1)//2], s[(n+1)//2:]
    m = len(l)
    ll, lr = l[:(m-1)//2], l[(m+1)//2:]
    rl, rr = l[:(m-1)//2], l[(m+1)//2:]
    if ll == lr[::-1] and rl == rr[::-1] and l == r:
        print("Yes")
    else:
        print("No")

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

Solution (Python):
S = input()
f = S[:((len(S) - 1) // 2)]
b = S[((len(S) + 3) // 2) - 1:]
r = ''.join(reversed(list(S)))

if f == b and S == r:
  print('Yes')
else:
  print('No')

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



a=int((len(S)-1)/2)

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

if is_kaibun(S) and is_kaibun(S[:a]) and is_kaibun(S[a+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()

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

if is_kaibun(s) and is_kaibun(s_1) and is_kaibun(s_2):
  print('Yes')
else:
  print('No')

Solution (Python):
def kaibun(s):
    if len(s) == 2:
        if s[0] == s[1]:
            return 1
        else:
            return 0
    else:
        h = int(len(s) / 2)
        for a, b in zip(s[:h], reversed(s[h+1:])):
            if a != b: return 0
        return 1

line = input()
n = len(line)
mae = int((n-1)/2)
usiro = int((n+3)/2)-1
kaibun1 = line[0:mae]
kaibun2 = line[usiro:]

if kaibun(line) == 1 and kaibun(kaibun1) == 1 and kaibun(kaibun2) == 1:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
import math
i=0
S=input()
n=int(len(S))
if S==S[::-1]:
    i=i+1
foreS=S[:int((n-1)/2)]
backS=S[int((n+1)/2):]
if foreS==foreS[::-1]:
    i=i+1
if backS==backS[::-1]:
    i=i+1
if i==3:
    print("Yes")
else:
    print("No")

Solution (Python):
def main():

    S = input()
    S_1 = S[:int((len(S)-1)/2)]
    S_2 = S[int((len(S)+3)/2)-1:]

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

    

if __name__ == '__main__':
    main()

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

i = int(((n-1)/2)-1)
j = int(((n+3)/2)-1)

l = s[:i+1]
l2 = l[::-1]
r = s[j:]
r2 = r[::-1]

if l == l2 and r == r2 and s == S:
  print('Yes')
else:
  print('No')

Solution (Python):
import sys
S=input()
N=len(S)
S1=list(S[0:(N-1)//2])
S2=list(S[(N+3)//2-1:])
S=list(S)
S.pop(N//2)
if(len(S1)%2==1):
    S1.pop(len(S1)//2)

if(len(S2)%2==1):
    S2.pop(len(S2)//2)

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

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

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

Solution (Python):

s = input()



a = (len(s) - 1) // 2
b = (len(s) + 3) // 2 - 1
aa = s[0: a]
bb = s[b:]

if aa == bb:
    print("Yes")
else:
    print("No")

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

Solution (Python):
s=list(input())
n=len(s)
r=reversed(s)
f=s[0:(n-1)//2]
l=s[(n+3)//2-1:n]
rf=reversed(f)
rl=reversed(l)
a="".join(s)
b="".join(r)
c="".join(f)
d="".join(rf)
e="".join(l)
f1="".join(rl)
if a==b and c==d and e==f1:
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()

end = len(S)
half = int(end/2)

for i in range(0,half):
    if S[i] is not S[half-1-i]:
        print("No")
        exit()
        
S1 = S[0:half]
S2 = S[half+1:end]

if S1 == S2:
    print("Yes")
else:
    print("No")

Solution (Python):
def solver():
    S = list(input())
    n = len(S)
    a = (n - 1) // 2
    b = (n + 3) // 2
    s1 = S[:a]
    s3 = S[b-1:]
    if S == S[::-1]:
        if s1 == s1[::-1]:
            if s3 == s3[::-1]:
                print('Yes')
            else:
                print('No')
        else:
            print('No')
    else:
        print('No')

if __name__ == '__main__':
    solver()

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

Solution (Python):
import sys
s = input()
s_len = len(s)
s_rev = s[::-1]

if s != s_rev:
  print('No')
  sys.exit()

s_bf_p = int((s_len-1)/2)
s_bf = s[0:s_bf_p]
s_bf_rev = s_bf[::-1]

if s_bf != s_bf_rev:
  print('No')
  sys.exit()

s_af_p = int((s_len+3)/2 - 1)
s_af = s[s_af_p:s_len]
s_af_rev = s_af[::-1]

if s_af != s_af_rev:
  print('No')
  sys.exit()

print('Yes')

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

Solution (Python):
S = input()
N = len(S)
def strong(word):
    n = len(word)
    flag = True
    for i in range(n):
        if word[i] != word[-i-1]:
            flag = False
            break
        else:
            continue
    return flag
if strong(S) and strong(S[0:int((N-1)/2)]):
    print('Yes')
else:
    print('No')

Solution (Python):
import sys

s = input()
n = len(s)
center_num_pre = (n - 1) // 2

flag = "Yes"
for i in range(center_num_pre):
    
    
    if s[i] != s[(n - 1) - i]:
        flag = "No"
        break

if flag == "No":
    print(flag)
    sys.exit()
    
for i in range(center_num_pre // 2):
    
    
    if s[i] != s[(center_num_pre - 1) - i]:
        
        flag = "No"
        break
    
if flag == "No":
    print(flag)
    sys.exit()
    
for i in range(center_num_pre // 2):
    
    
    if s[i] != s[(n - 1) - i]:
        flag = "No"
        break

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

Solution (Python):


S = input()
N = len(S)
a = S[: int((N - 1) / 2)]
b = S[int((N + 3) / 2) - 1 :]
ans = "Yes" if S == S[::-1] and a == a[::-1] and b == b[::-1] else "No"

print(ans)

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

Solution (Python):
S = [c for c in input()]
N = len(S) - 1
s1 = S[:(N-1)//2 + 1]
s2 = S[(N+3)//2:]

rs = list(reversed(S))
rs1 = list(reversed(s1))
rs2 = list(reversed(s2))
if S == rs and s1 == rs1 and s2 == rs2:
    print("Yes")
else:
    print("No")

Solution (Python):
s = list(input())
flag = 0
for i in range(-(-len(s)//(2))):
    if s[i] != s[len(s)-1-i]:
        flag = 1
s1 = s[0:-(-len(s)//(2))-1]
s2 = s[-(-len(s)//(2)):len(s)]
for i in range(-(-len(s1)//(2))):
    if s1[i] != s1[len(s1)-1-i]:
        flag = 1
for i in range(-(-len(s2)//(2))):
    if s2[i] != s2[len(s2)-1-i]:
        flag = 1
if flag == 0:
    print('Yes')
else:
    print('No')

Solution (Python):
a=input()
a=list(a)
a1=[]
b1=[]
c1=[]
for i in range(len(a)-1,-1,-1):
    a1.append(a[i])
b=a[0:(len(a)-1)//2]
for i in range(len(b)-1,-1,-1):
    b1.append(a[i])
c=a[(len(a)+3)//2-1:len(a)]
for i in range(len(c)-1,-1,-1):
    c1.append(a[i])



if(a==a1):
    if(b==b1 and c==c1):
        print("Yes")
    else:
        print("No")
else:
    print("No")

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

if s[:(l-1)//2:] == s[(l-1)//2-1::-1] and s[(l-1)//2+1::] == s[:(l-1)//2:-1] and s[:(l-1)//2:] == s[(l-1)//2+1::]:
    print('Yes')
else:
  print('No')

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

a = s[0:int((l-1)/2)]
b = s[int((l+3)/2)-1:l]

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

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


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

Solution (Python):
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))

s = ns()
n = len(s)
t = s[:n//2]
u = s[n//2+1:]
if s == s[::-1] and t == t[::-1] and u == u[::-1]:
    print('Yes')
else:
    print('No')

Solution (Python):
S = input()

halfLength = len(S) // 2
mae = S[:halfLength] 
ushiro = ''.join(list(reversed(S[halfLength+ 1:])))
answer = 'No'
if mae == ushiro:
    mae_halflen =  len(mae) // 2
    mae_mae = mae[mae_halflen:] 
    mae_ushiro = ''.join(list(reversed(mae[:mae_halflen + len(mae) % 2])))
    if (mae_mae == mae_ushiro):
         answer = 'Yes'
print(answer)

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

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

S = input()
string_len = len(S)
if(checkPalindrome(S) and checkPalindrome(S[:int((string_len-1)/2)]) and checkPalindrome(S[int((string_len + 3)/2-1):])):
    print("Yes")
else:
    print("No")

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

flag = 0
if S == S_reverse1:
  flag += 1

S_reverse2 = list(reversed(S[: (len(S) - 1) // 2]))
S_reverse3 = list(reversed(S[(len(S) + 1) // 2 :]))

if S_reverse2 == S[: (len(S) - 1) // 2] and S_reverse3 == S[(len(S) + 1) // 2 :]:
  flag += 1
  
if flag == 2:
  print('Yes')
else:
  print('No')

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

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

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

if tmp1 !="".join(list(reversed(tmp1))):
    print("No")
elif tmp2 !="".join(list(reversed(tmp2))):
    print("No")
elif s !="".join(list(reversed(s))):
    print("No")
else:
    print("Yes")

Solution (Python):
S = list(input())
N = len(S)
n1 = (N - 1) // 2
n2 = (N + 3) // 2

res1 = S[:n1]
res2 = S[n2-1:]

if(S == list(reversed(S)) and res1 == list(reversed(res1)) and res2 == list(reversed(res2))):
    print('Yes')
else:
    print('No')

Solution (Python):
S = input()
N = len(S)
left = S[:N // 2]
right = S[N // 2 + 1:]
last = S[(N+3)//2-1:]

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

Solution (Python):
S=input()
N=len(S)
ans=0
A=list(S[0:N//2])
B=list(S[N//2+1:])
A_R=list(reversed(A))
B_R=list(reversed(B))
if A==B and A==A_R and B==B_R:
    print("Yes")
else:
    print("No")

Solution (Python):
def check1(s):
    if len(s) % 2 == 1:
        return True
    else:
        return False


def helper(s):
    if len(s) % 2 == 0:
        return _helper_even(s)
    else:
        return _helper_odd(s)


def _helper_odd(s):
    center = int(len(s) / 2)
    s1 = s[:center]
    s2 = s[center + 1:]
    s2 = s2[::-1]

    for c1, c2 in zip(s1, s2):
        if c1 != c2:
            return False
    else:
        return True


def _helper_even(s):
    center = int(len(s) / 2)
    s1 = s[:center]
    s2 = s[center:]
    s2 = s2[::-1]

    for c1, c2 in zip(s1, s2):
        if c1 != c2:
            return False
    else:
        return True


def check2(s):
    if not helper(s):
        return False

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

    if not helper(s1):
        return False
    if not helper(s2):
        return False

    return True


def main():
    s = input().strip()

    if check1(s) and check2(s):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Solution (Python):
def judge(S):
    N = len(S)
    if S[:(N-1)//2] != S[(N+1)//2:][::-1]:
        return False
    elif S[:(N-1)//2] != S[(N+1)//2:]:
        return False
    else:
        return True


S = input()
if judge(S):
    print("Yes")
else:
    print("No")

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

S0 = [i for i in input()]

n = len(S0)
m = (n-1)/2
S1 = S0[:int((n-1)/2)]
S2 = S0[int((n+3)/2)-1:]


if palindrome(S0) + palindrome(S1) +palindrome(S2) == 0:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()

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

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

Solution (Python):
import sys


def ispPlindrome(s):
    if len(s) <= 1:
        return True
    else:
        return s[0] == s[-1] and ispPlindrome(s[1:-1])

s = input()
n = len(s)

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

Solution (Python):
import math


def kaibun_check(texts):
    n = len(texts)
    if texts == texts[::-1]:
        return True
    return False


def main():
    S = list(input())
    N = len(S)
    if not kaibun_check(S):
        print("No")
        return
    if not kaibun_check(S[0:(N - 1) // 2]):
        print("No")
        return
    if not kaibun_check(S[math.ceil((N + 3) / 2) - 1:]):
        print("No")
        return
    print("Yes")
    return


main()

Solution (Python):
import sys
S = list(str(input()))
length = len(S)

half = int((length-1)/2)
halfhalf = int(half/2)
condition3 = int((length+3)/2)

for i in range(half):
    if S[i] != S[-i-1]:
        print("No")
        sys.exit()
halfS = S[:half]
if len(halfS) == 1:
    pass
else:
    for i in range(halfhalf):
        if halfS[i] != halfS[-i-1]:
            print("No")
            sys.exit()

S3 = S[condition3-1:]
if len(S3) == 1:
    pass
else:
    half_S3 = int(len(S3)/2)
    for i in range(half_S3):
        if S3[i] != S3[-i-1]:
            print("No")
            sys.exit()
print("Yes")

Solution (Python):
S = input()

f = 0


def judge(S):
    print()
    if S[:len(S)//2]==S[:len(S)//2+len(S)%2-1:-1]:
        return True
    else:
        return False


if judge(S) and judge(S[:len(S)//2]) and judge(S[len(S)//2+len(S)%2:]):
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()
N = len(S)
result = "Yes"
for i in range((N+1)//2):
    if S[i] != S[N-1-i]:
        result = "No"
        break

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

Solution (Python):
s = input()
r = "".join(reversed(s))
if s != r:
    print("No")
else:
    a = (len(s)-1)//2
    b = (len(s)+3)//2 - 1
    te = "".join(reversed(s[:a]))
    te2 = "".join(reversed(s[b:]))
    if s[:a] == te and s[b:] == te2:
        print("Yes")
    else:
        print("No")

Solution (Python):
a=input()
import sys
if len(a)%2==0:
    print('No')
    sys.exit()
d=(len(a)-1)//2

b=a[0:int(d)]
e=(len(a)+3)/2-1
c=a[int(e):int(len(a))]
r=['']*len(b)
w=['']*len(c)
for i in range(len(b)):
    r[i]+=b[i]
for i in range(len(c)):
    w[i]+=c[i]

b1=r
b1.reverse()
c1=w
c1.reverse()

if b1==r and c1==w and r==w:
    print('Yes')
else:
    print('No')

Solution (Python):
a=0;b=0;c=0
S=list(input())
N=len(S)
T=S[:]
S.reverse()


if S==T:
  a=1

x=(N-1)//2
y=(N+2)//2
X=S[0:x]
X1=X[:]
X.reverse()
if X==X1:
  b=1
Y=S[y:N]
Y1=Y[:]
Y.reverse()
if Y==Y1:
  c=1


if a*b*c==1:
  print("Yes")
else:
  print("No")

Solution (Python):

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

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

def main():
    S = input()

    N = len(S)

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


if __name__ == '__main__':
    main()

Solution (Python):
s = input()
N = len(s)
ok = True
if s[:] != s[::-1]:
    ok = False

if s[:N//2] !=  s[:N//2][::-1]:
    ok = False


if s[N//2+1:] != s[N//2+1:][::-1]:
    ok = False


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

Solution (Python):
import sys
S = input()

n = len(S)

if S == S[::-1]:
  a = (n-1)//2
  b = (n+1)//2
  s1 = S[0:a]
  s2 = S[b:n]
  if s1 == s1[::-1] and s2 == s2[::-1]:
    print("Yes")
    sys.exit()
print("No")

Solution (Python):
S = input()
half_l = int((len(S) -1)/2)
mae = S[0:half_l]
ato = S[half_l+1:len(S)]

start = int((len(S) +3)/2)
target_str = S[start-1:len(S)]

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

if not ispalindrome(S):
    print('No')
    exit(0)

if not ispalindrome(mae):
    print('No')
    exit(0)

if not ispalindrome(target_str):
    print('No')
    exit(0)
print('Yes')

Solution (Python):
import sys

S = list(input())

N = len(S)

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



if S == S[::-1]:
    if S1 == S1[::-1]:
        if S2 == S2[::-1]:
            print("Yes")
            sys.exit()

print("No")

Solution (Python):
import math
import sys 
s = input()
if s==s[::-1]:
    n = len(s)
    right = int((n-1)/2)
    tmp = s[:right]
    if tmp == tmp[::-1]:
        left = int((n+3)/2)
        tmp2 = s[left-1:]
        if tmp2 == tmp2[::-1]:
            print('Yes')
            sys.exit()
print('No')

Solution (Python):
def R(S):
    return "".join(reversed([c for c in S]))

def solve(S):
    l = len(S)
    if not S == R(S):
        return False
    if not S[0: (l - 1) // 2] == R(S[0: (l - 1) // 2]):
        return False
    if not S[(l - 1) // 2 + 1:] == R(S[(l - 1) // 2 + 1:]):
        return False

    return True

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

if __name__ == '__main__':
    main()

Solution (Python):
s = input()

first = (len(s)-1)//2
sec = (len(s)+3)//2

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

Solution (Python):



def isPalindrome(s: str):
    return list(s) == list(reversed(s))

S = input()
N = len(S)

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

if all([isPalindrome(x) for x in [S, s2, s3]]):
    print("Yes")
else:
    print("No")

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

s = input()

if palindrome(s) == 0:
  n = (len(s) - 1) // 2
  front = s[:n]
  end = s[(n + 1):]
  if palindrome(front) == 0 and palindrome(end) == 0:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Solution (Python):
S = list(input())
N = len(S)
T = [i for i in S[::-1]]
U = []
for i in range(int((N-1)/2)):
    U.append(S[i])
V = [i for i in U[::-1]]
W = []
for i in range(int((N + 3)/2 -1),N):
    W.append(S[i])
X = [i for i in W[::-1]]
if S != T:
    print('No')
elif U != V:
    print('No')
elif W != X:
    print('No')
else:
    print('Yes')

Solution (Python):
s = input()
l = len(s)
c = (l-1)//2

count = 0
check = 0
for i in range(0,c-1):
  if s[i] == s[l-i-1]:
    count = count + 1
    
if count == c-1:
  check = check + 1

count1 = 0  
for j in range(0, c-1):
  if s[j] == s[c-j-1]:
    count1 = count1 + 1

if count1 == c-1:
  check = check + 1

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

Solution (Python):
s=list(input())
flg=1
n=len(s)
s_reverse=list(reversed(s))
if s!=s_reverse:
    flg=0
s_2=s[:int((n-1)/2)]
s_2_reverse=list(reversed(s_2))
if s_2!=s_2_reverse:
    flg=0
s_3=s[int((n+3)/2)-1:]
s_3_reverse=list(reversed(s_3))
if s_3!=s_3_reverse:
    flg=0
if flg==0:
    print("No")
else:
    print("Yes")

Solution (Python):

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


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

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

Solution (Python):
import sys
s=input()
n=len(s)
judge=True
for i in range(int((n+1)/2),n):
  if s[i]==s[i-int((n+1)/2)]:
    pass
  else:
    print("No")
    judge=False
    sys.exit()
if judge==True:
  print("Yes")

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

def palind(word):
  word = word.lower()
  return word[::-1] ==word

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

text1 =S[0::num1]
text2 =S[num2-1::]

if palind(S) == True and palind(text1) == True and palind(text2) == True:
  print("Yes")
else:
  print("No")

Solution (Python):
def check(s):
  n=len(s)
  if s!=s[::-1]:
    return "No"
  temp=s[:(n-1)//2]
  if temp!=temp[::-1]:
    return "No"
  temp=s[((n+3)//2)-1:]
  if temp!=temp[::-1]:
    return "No"
  return "Yes"
s=input()
print(check(s))

Solution (Python):
def is_kaibun(s):
    s_rev = s[::-1]
    if s == s_rev:
        return True
    else:
        return False

s = input()
if is_kaibun(s):
    half_len = int((len(s) - 1) / 2)
    half_s = s[:half_len]
    if is_kaibun(half_s):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Solution (Python):
S = input()



half_num = len(S) // 2
front = S[:half_num]
back = S[half_num+1:]


is_true = True
if front == back:
    for idx in range((len(S)-1)//2):
        if S[idx] != S[-(idx+1)]:
            is_true = False
else:
    is_true = False

if is_true:
    print('Yes')

else:
    print('No')

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

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

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

m_1 = (len(s) - 1) // 2
m_2 = m_1 + 1
ans = 'Yes' if check(s) and check(s[:m_1]) and check(s[m_2:]) else 'No'

print(ans)

Solution (Python):
text = input()
index = (len(text)-1)//2

if text[::-1] == text and text[:index][::-1] == text[:index] and text[index+1:][::-1] == text[index+1:]:
    print("Yes")
else:
    print("No")

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

i1 = int((N-1)/2)
i2 = int((N+3)/2)-1
strong = True
if not ispalindrome(S):
  strong = False
if not ispalindrome(S[:i1]):
  strong = False
if not ispalindrome(S[i2:]):
  strong = False

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

Solution (Python):

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

S_inv = S[::-1]

S_mae = S[:int((N-1)/2)]
S_mae_inv = S_mae[::-1]

S_ushiro = S[int((N+1)/2):]
S_ushiro_inv = S_ushiro[::-1]

if (S == S_inv and S_mae == S_mae_inv and S_ushiro == S_ushiro_inv):
    print("Yes")

else:
    print("No")

Solution (Python):
s = input()
n = len(s)
ans = 'Yes'
if s != s[::-1]:
    ans = 'No'
seq1 = int((n - 1) / 2)
if s[:seq1] != s[seq1-1::-1]:
    ans = 'No'
seq2 = int((n + 3) / 2)
if s[seq2-1:] != s[n:seq2-2:-1]:
    ans = 'No'
print(ans)

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

def kai(s):
  n = len(s)
  if n % 2 != 0:
    if s[:int((n-1)/2)] == s[int((n+1)/2):][::-1]:
      return True
    else:
      return False
  else:
    if s[:int(n/2)] == s[int(n/2):][::-1]:
      return True
    else:
      return False

s1 = s[:int((n-1)/2)]
s2 = s[int((n+1)/2):]


if sum([kai(s),kai(s1),kai(s2)]*1) == 3:
  print('Yes')
else:
  print('No')

Solution (Python):
def resolve():
    s = input()
    if not kaibun(s) :
        print('No')
        return
    n = len(s)
    n1 = (n - 1) // 2
    if not kaibun(s[:n1]) :
        print('No')
        return
    n2 = (n + 3) // 2 - 1
    if not kaibun(s[n2:]) :
        print('No')
        return
    print('Yes')

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

resolve()

Solution (Python):
S = input()
L = len(S)
Half = (L-1)//2
for l in range(Half):
    if S[l] != S[L-l-1] or S[l] != S[Half-l-1]:
        print("No")
        exit()
print("Yes")

Solution (Python):
S = input()

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

N = len(S)
is_kaibun(S)
is_kaibun(S[:(N-1)//2])
is_kaibun(S[(N+3)//2-1:])
print('Yes')

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

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


s = input()
n = len(s)
ans = "Yes"
if (
    not is_palindrome(s)
    or not is_palindrome(s[0 : (n - 1) // 2])
    or not is_palindrome(s[(n + 3 - 1) // 2 :])
):
    ans = "No"
print(ans)

Solution (Python):
S = input()
Flg = "Yes"

for i in range(len(S)//2):
    if(S[i] != S[len(S)-i-1]):
        Flg = "No"
for i in range((len(S)-1)//2):
    if(S[i] != S[(len(S)-1)//2-i-1]):
        Flg = "No"
j = 0
for i in range((len(S)+3)//2-1, len(S)):    
    if(S[i] != S[len(S)-j-1]):
        Flg = "No"
    j += 1    
print(Flg)

Solution (Python):
S = input()

halfLen = len(S)//2

if halfLen % 2 == 1 and S[0:halfLen//2] == S[halfLen//2+1:halfLen][::-1] and S[halfLen+1:halfLen+1+halfLen//2] == S[len(S)-halfLen//2:len(S)][::-1] and S[0:halfLen] == S[halfLen+1:len(S)][::-1]:
  print('Yes')
elif halfLen % 2 == 0 and S[0:halfLen//2] == S[halfLen//2:halfLen][::-1] and S[halfLen+1:halfLen+1+halfLen//2] == S[len(S)-halfLen//2:len(S)][::-1] and S[0:halfLen] == S[halfLen+1:len(S)][::-1]:
  print('Yes')
else:
  print('No')

Solution (Python):
def is_pali(s, start, end):
	cpy = s[start:end]
	rev = cpy[::-1]
	if cpy == rev:
		return 1
	else:
		return 0

s = input()
n = len(s)
if is_pali(s, 0, n) and is_pali(s, 0, (n - 1) // 2) and is_pali(s, ((n + 3) // 2) - 1, n):
	print('Yes')
else:
	print('No')

Solution (Python):
def kaibun(s):
    flg = True
    i, j = 0, len(s)-1
    while i <= j:
        if s[i] != s[j]:
            flg = False
        i += 1
        j -= 1
    return flg


sr = input()
n = len(sr)
flg = kaibun(sr)
s2 = sr[:(n-1)//2]
flg *= kaibun(s2)
s3 = sr[(n+3)//2-1:]
flg *= kaibun(s3)
if flg:
    print("Yes")
else:
    print("No")

Solution (Python):
from sys import stdin

def main():

    input = stdin.readline

    S = input()[:-1]

    zenhan = S[0:int(len(S)/2)]
    kouhan = S[int(len(S)-((len(S)-1)/2)):]

    
    if zenhan == kouhan[::-1]:
        zenhan_z = zenhan[0:int(len(zenhan)/2)]
        zenhan_k = zenhan[int(len(zenhan)-((len(zenhan)-1)/2)):]
        if zenhan_z == zenhan_k[::-1]:
            kouhan_z = kouhan[0:int(len(kouhan)/2)]
            kouhan_k = kouhan[int(len(kouhan)-((len(kouhan)-1)/2)):]
            if kouhan_z == kouhan_k[::-1]:
                print("Yes")
                return
    
    print("No")

    
if __name__ == "__main__":
    main()

Solution (Python):
s = list(input())
t = s[::-1]
n = len(s)
if s != t:
  print ('No')
  exit()
if n == 3:
  print('Yes')
  exit()
d = s[:int((n-1)/2)]
e = d[::-1]

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

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