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



Sample input:
akasaka


Sample output:
Yes

Submission status: Accepted

Solution code:
s=input()
n=len(s)
for i in range(0,(n-1)//2):
    if s[i]!=s[n-1-i]:
        print("No")
        break
else:
    for j in range(0,((n-1)//2)//2):
        if s[j]!=s[((n-1)//2)-1-j]:
            print("No")
            break
    else:
        for k in range((n+1)//2,(3*n+1)//4):
            if s[k]!=s[n-1-(k-(n+1)//2)]:
                print("No")
                break
        else:
            print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

l = len(s)

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

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

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

print("Yes")

Submission status: Accepted

Solution code:
def hantei(moji):
    l=len(moji)
    kano=True
    for i in range((l)//2):
        if(moji[i]!=moji[l-i-1]):
            kano=False
    return kano

s=input()
n=len(s)
ans=hantei(s) and hantei(s[:n//2]) and hantei(s[n//2+1:])

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

Submission status: Accepted

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

    for i in range(N) :
        if (S[i] != S[-i-1]) :
            print("No")
            return
    
    a = (N-1) // 2
    S1 = S[0:a]
    for i in range(len(S1)) :
        if (S1[i] != S1[-i-1]) :
            print("No")
            return
    
    a = (N+3) // 2
    S2 = S[a-1:]
    for i in range(len(S2)) :
        if (S2[i] != S2[-i-1]) :
            print("No")
            return
    
    print("Yes")
    
            
    


main()

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

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

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

if s == list(reversed(s)) and ss == list(reversed(ss)) and sss == list(reversed(sss)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from sys import stdin


def check_palindrome(str_):
    if str_ == str_[::-1]:
       return True
    return False

def get_result(data):
    S = data[0]
    right_idx = int((len(S) - 1) / 2)
    left_idx = int((len(S) + 3) / 2) - 1
    right_S = S[0:right_idx]
    left_S = S[left_idx:]
    if check_palindrome(S) and check_palindrome(right_S) and check_palindrome(left_S):
        return 'Yes'
    return 'No'


if __name__ == '__main__':
    data = list(map(str, stdin.readline().rstrip('\n').split(' ')))
    result = get_result(data)
    print(result)

Submission status: Accepted

Solution code:
s = input()

n = len(s)

ans = 0

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

s5 = s[::-1]

s3 = s1[::-1]
s4 = s2[::-1]

#print(s5, s3, s4)
if s1 == s3:
    ans += 1

if s2 == s4:
    ans += 1

if s == s5:
    ans += 1

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

Submission status: Accepted

Solution code:
def kaibun(S):
    return S == S[::-1]
def solve():
    S = input()
    n = len(S)
    if not kaibun(S):
        return "No"
    if not kaibun(S[:n // 2]):
        return "No"
    if not kaibun(S[(n + 3) // 2 - 1:]):
        return "No"
    return "Yes"
print(solve())

Submission status: Accepted

Solution code:
# coding: utf-8

s = raw_input()

def isp(x):
    leng = len(x)
    #print leng
    #print [(s[i], s[leng - i - 1]) for i in xrange(leng // 2)]
    return all(s[i] == s[leng - i - 1] for i in xrange(leng // 2))

n = len(s)
x1 = s[0:n // 2]
x2 = s[(n + 3) // 2 - 1:n]
#print s
#print x1,0,n//2
#print x2,(n+3)//2-1,n
print ['No', 'Yes'][isp(s) and isp(x1) and isp(x2)]

Submission status: Accepted

Solution code:
def is_kaibun(s):
    for i, j in enumerate(s[:int(len(s)/2)+1]):
        if j != s[-(i+1)]:
            return False
    return True


def main():
    s = input()
    n = len(s)
    result = is_kaibun(s)
    if result:
        s_2 = s[0:int((n-1)/2)]
        result = is_kaibun(s_2)
    if result:
        s_3 = s[int((n + 3) / 2 - 1):]
        result = is_kaibun(s_3)
    print("Yes" if result else "No")

main()

Submission status: Accepted

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

Submission status: Accepted

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

J=S[:int((N-1)/2)]
K=S[int((N+3)/2)-1:]

S_R=''.join(list(reversed(S)))
J_R=''.join(list(reversed(J)))
K_R=''.join(list(reversed(K)))

if (S==S_R)and(J==J_R)and(K==K_R):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
l=len(s)
print("Yes" if s[:l//2][::-1]+s[l//2]+s[(l+1)//2:][::-1]==s==s[::-1] else "No")

Submission status: Accepted

Solution code:
def isPalindrome(st): 
    for i in range(0, int(len(st)/2)):  
        if st[i] != st[len(st)-i-1]: 
            return False
    return True
st = input()
if isPalindrome(st):
	n1 = int((len(st) - 1)/2)
	n2 = int((len(st) + 3)/2) - 1
	if isPalindrome(st[0:n1]):
		if isPalindrome(st[n2:]):
			print("Yes")
		else:
			print("No")
	else:
		print("No")
else:
	print("No")

Submission status: Accepted

Solution code:
s = list(input())
s1 = s[0:int((len(s)-1)*0.5)]
s2 = s[int((len(s)+3)*0.5)-1:len(s)]
s_o =s[::-1]
s1_o =s1[::-1]
s2_o =s2[::-1]
# print("so...{}/s1o....{}/s2o...{}/s...{}/s1...{}/s2...{}/".format(s_o, s1_o, s2_o, s, s1, s2))
if s1_o == s1:
    if s2_o == s2:
        if s_o == s:
            yn = "Yes"
        else:
            yn = "No"
    else:
        yn = "No"
else:
    yn = "No"
print(yn)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    target = input()
    start = target[:int((len(target)-1)/2)]
    end = target[int((len(target)+3)/2)-1:]
    test = target[::-1]
    print("Yes" if target == target[::-1] and start == start[::-1] and end == end[::-1] else "No")

Submission status: Accepted

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

ans = True


def check(s):
    length = len(s)
    ans2 = True
    for i in range(length//2):
        # print("{}:{}".format(s[i], s[length-i-1]))
        if s[i] != s[length-i-1]:
            ans2 = False
    return ans2


ans = check(s)

if ans:
    # print(s[0:n//2])
    ans = check(s[0:n//2])
# else:
    # print("cond1 fail")

if ans:
    # print(s[((n+3)//2-1):n])
    ans = check(s[((n+3)//2-1):n])
# else:
    # print("cond2 fail")

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

Submission status: Accepted

Solution code:
S = input()

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

if kaibun == True:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
y_id = (n+1)//2
ans = 0
if s==s[::-1]:
    ans += 1
sa = s[0:y_id-1]
if sa==sa[::-1]:
    ans += 1
sb = s[y_id:n]
if sb==sb[::-1]:
    ans += 1
if ans==3:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
n=len(s)
s1=s[:n//2]
s2=s[n//2+1:]
test =True
if(s!=s[::-1]):
	test=False
if (s1!=s1[::-1]):
	test=False
if(s2!=s2[::-1]):
	test=False
if(test==True):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
line=input()
n=len(line)
flag=True

if line!=line[::-1]:
    flag=False
if line[0:int((n-1)/2)]!=line[0:int((n-1)/2)][::-1]:
    flag=False
if line[int((n+3)/2)-1:n]!=line[int((n+3)/2)-1:n][::-1]:
    flag=False
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=list(input())
#print(s)
s1=s[::-1]
#print(s1)
s2=s[:(len(s)-1)//2]
s2a=s2[::-1]
#print(s2)
s3=s[((len(s)+3)//2)-1:]
s3a=s3[::-1]
#print(s3)
#print((len(s)-1)//2)
#print((len(s)+3)//2)

if s==s1 and s2==s2a and s3==s3a:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
rev = S[::-1]
half = len(S)//2
str1 = S[0:half]
str1_rev = str1[::-1]
str2 = S[half+1:]
str2_rev = str2[::-1]
if S != rev or str1 != str1_rev or str2 != str2_rev:
    print('No')
    exit()
print('Yes')

Submission status: Accepted

Solution code:
S = input()
n = len(S)
p = (n-1)//2
q = (n+3)//2 - 1
A = S[:p]
B = S[q:]
ans = 'Yes'
for i in range(len(S)):
    if S[i] != S[-i-1]:
        ans = 'No'
for i in range(len(A)):
    if A[i] != A[-i-1]:
        ans = 'No'
for i in range(len(B)):
    if B[i] != B[-i-1]:
        ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
s = list(input())
a = s[:(len(s)-1)//2]
b = s[(len(s)+2)//2:]

flag = True
for i in range(len(s)//2):
  if s[i] != s[len(s)-i-1]:
    flag = False
    break
  
flagA = True
for i in range((len(a)//2)):
  if a[i] != a[len(a)-i-1]:
    flagA = False
    break
    
flagB = True
for i in range(len(b)//2+1):
  if b[i] != b[len(b)-i-1]:
    flagB = False
    break
    
if flag and flagA and flagB:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()

n = len(s)
flag = True
for i in range((n-1)//2):
    if flag == False:
        break
    if s[i] != s[-(i+1)]:
        print('No')
        #print(i,'1')
        flag = False
    elif s[i] != s[-(i+2+(n-1)//2)]:
        print('No')
        #print(i,'2')
        flag = False
    elif s[(i-1+(n+3)//2)] != s[-(i+1)]:
        print('No')
        #print(i,'3')
        flag = False
    
if flag == True:
    print('Yes')

Submission status: Accepted

Solution code:
def kai(t):
    if len(t) > 1:
        c = len(t)//2
        c = int(c)
        u = t[:c]
        w = t[-c:]
        w = w[::-1]
        if u == w:
            return True
        else:
            return False
    elif len(t) == 1:
        return True

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

if (kai(s) == True) and (kai(b) == True) and (kai(c) == True):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def r(x):
    return list(reversed(x))

def main():
    import sys
    S=sys.stdin.readline().strip()
    L=list(S)
    N=len(S)
    if L==r(L) and L[:(N-1)//2]==r(L[:(N-1)//2]) and L[(N+3)//2-1:]==r(L[(N+3)//2-1:]):
        return 'Yes'
    else:
        return 'No'
    
print(main())

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def is_palindrome(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().strip()
    n = len(s)
    if is_palindrome(s) and is_palindrome(s[0:(n - 1) // 2]) and is_palindrome(s[((n + 3) // 2) - 1:n]):
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
if S[:int((N-1)/2)] == list(reversed(S[:int((N-1)/2)]))\
    and S[int((N+1)/2):] == list(reversed(S[int((N+1)/2):]))\
    and S == list(reversed(S)):

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

Submission status: Accepted

Solution code:
s = input()

n = len(s)
half = int((n-1)/2)
half_s = s[:half]
half_list = list(half_s)
for i in range(half):
    if half_list[i] != half_list[half-i-1]:
        print("No")
        exit()
if half_s != s[half+1:]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
import math
s = input()
l = len(s)
f = math.ceil((l-1)/2)
b = int((l+1)/2)
forward = s[:f]
back = s[b:]

if(forward == back):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#


def main():
    s = input()
    n = len(s)
    i = 0
    j = n - 1
    while i < j:
        if s[i] != s[j]:
            print("No")
            return
        i += 1
        j -= 1
    i = 0
    mae_last = (n - 1) // 2 - 1
    usiro_first = (n + 3) // 2 - 1
    while i < mae_last:
        if s[i] != s[mae_last]:
            print("No")
            return
        i += 1
        mae_last -= 1
    i = n - 1
    while i > usiro_first:
        if s[usiro_first] != s[i]:
            print("No")
            return
        i -= 1
        usiro_first += 1
    print("Yes")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A=input()
B=A[0:len(A)//2]

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

else:
  if B!=B[::-1]:
    print("No")
  else:
    print("Yes")

Submission status: Accepted

Solution code:
s = input()

first = s[:int((len(s)-1)/2)]
last  = s[int((len(s)+2)/2):]

isOK = True

for i in range(int(len(first)/2)):
    if first[i] != first[len(first)-i-1]:
        isOK = False
    
    if last[i] != last[len(last)-i-1]:
        isOK = False

    if first != last:
        isOK = False

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

Submission status: Accepted

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

s = str(input())

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

Submission status: Accepted

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

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

ss = S[:(N - 1) // 2]
# print(ss)
if ss[::-1] != ss:
    print("No")
    exit()

sss = S[(N + 3) // 2 - 1:]
# print(sss)
if sss[::-1] != sss:
    print("No")
    exit()

print("Yes")

Submission status: Accepted

Solution code:
S=input()
n=len(S)
t=S[0:int((n-1)/2)]
u=S[int((n+1)/2):]
if S==S[::-1] and t==t[::-1] and u==u[::-1]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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


def solve():
    S = input()
    N = len(S)
    if ispalindrome(S):
        left = S[:int(((N-1)/2))]
        if ispalindrome(left):
            right = S[int(((N+3)/2)-1):]
            if ispalindrome(right):
                print("Yes")
                exit()

    print("No")


# Solve
if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
#!/usr/bin/python

s = input()
n = len(s)

def cond1(s):
    n = len(s)
    for i in range(n // 2):
        if s[i] != s[-1-i]:
#            print("{}: False".format(s))
            return False
    return True

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

Submission status: Accepted

Solution code:
s = input()

def kaibun_check(s):
    n = len(s)
    zenhan_s = s[:int((n - 1)/2)]
    zenhan = zenhan_s == zenhan_s[::-1]
    kouhan_s = s[int((n + 1)/2):]
    kouhan = kouhan_s == kouhan_s[::-1]
    return zenhan and kouhan and (s == s[::-1])

print("Yes" if kaibun_check(s) else "No")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

s = input()
c = 0
for i in range((len(s) - 1)// 2):
    if s[i] == s[-1 - i] and s[i] == s[(len(s) - 1)// 2 - 1 - i]:
        pass
    else:
        c += 1
        break

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

Submission status: Accepted

Solution code:
s=input()
k=s[::-1]
c=0
if s==k:
    c+=1
f=((len(s)-1)//2)

s1=s[0:f]
#print(s1)
s1p=s1[::-1]
if s1==s1p:
    c+=1
f1=(((len(s)+3)//2)-1)
s2=s[f1:]
#print(s2)
s2p=s2[::-1]
if s2==s2p:
    c+=1
if c==3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

s = input()
len_s = len(s)
ans = True
if is_palindrome(s) == False:
    ans = False
if is_palindrome(s[0:(len_s - 1) // 2]) == False or is_palindrome(s[(len_s + 1) // 2:len_s]) == False:
    ans = False
if ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

strong = True
N = len(S)

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

tmp = S[:int((N-1)/2)]
for i in range(int(len(tmp)-1/2)):
    if tmp[i] != tmp[-i-1]:
        strong = False


tmp = S[int((N+3)/2)-1:]
for i in range(int(len(tmp)-1/2)):
    if tmp[i] != tmp[-i-1]:
        strong = False

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

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
ans = True

for i in range((n-1)//2):
    head = i
    tail = ((n-3)//2) - i

    
    if s[head] != s[tail]:
        ans = False
        
    head2 = i + (n+1)//2
    tail2 = - i + n - 1
    if s[head2] != s[tail2]:
        ans = False
        
    if s[head] != s[tail2] or s[tail] != s[head2]:
        ans = False
        
    if ans == False:
        break
    
if ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

def check_palindrome(txt):
  return txt == ''.join(list(txt)[::-1])

ep1 = len(S) // 2
txt1 = S[0:ep1]

sp2 = len(S) // 2 + 1
txt2 = S[sp2:]

if check_palindrome(S):
  if check_palindrome(txt1):
    if check_palindrome(txt2):
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

Solution code:
S=input()
r=S[::-1]
N=len(S)
print('YNeos'[not(S==r and S[:(N-1)//2]==S[:(N-1)//2][::-1] and S[(N+3)//2-1:]==S[(N+3)//2-1:][::-1])::2])

Submission status: Accepted

Solution code:
S = str(raw_input())
N = len(S)

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

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

Submission status: Accepted

Solution code:
import sys

s = input()
r_s = s[::-1]
if(r_s != s):
    print('No')
    sys.exit()

n = (len(s)-1)//2
s_slice = s[0:n]
r_s_slice = s_slice[::-1]
if(s_slice != r_s_slice):
    print('No')
    sys.exit()

n = len(s)
s_3 = s[(n+3)//2 -1:]
r_s_3 = s_3[::-1]

if(s_3 != r_s_3):
    print('No')
    sys.exit()

print('Yes')

Submission status: Accepted

Solution code:
S = str(input())
x = int((len(S)-1)/2)
if S[:x] == S[-x:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def isKaibun(str):
  result = True
  for i in range(len(str)-1//2):
    if str[i] != str[-i-1]:
      result = False
      break
  return result

S = input().strip()
#N, M = list(map(int, input().strip().split()))
result = 'No'
N = len(S)
"""
print(S[0:(N-1)//2])
print(isKaibun(S[0:(N-1)//2]))
print(S[(N+3)//2-1::])
print(isKaibun(S[(N+3)//2-1::]))
"""
if isKaibun(S) and isKaibun(S[0:(N-1)//2]) and isKaibun(S[(N+3)//2-1::]):
  result = 'Yes'
print(result)

Submission status: Accepted

Solution code:
S=list(input())
SV=S[::-1]
N=len(S)

for i in range(N):
    F=1
    if S[i]!=SV[i]:
        F=0
        break

s=S[:N//2]
sv=s[::-1]
n=len(s)
#print(s)
for i in range(n):
    FF=1
#    print(s[i],s[-(i+1)])
    if s[i]!=sv[i]:
        FF=0
        break

if F and FF:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
l = len(S)
fl = (l-1)//2
sl = (l+3)//2 - 1
f = S[:fl]
s = S[sl:]
if f == f[::-1] and s == s[::-1] and S == S[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
f = s[:len(s)//2]
g = s[len(s)//2 + 1:]
if f == f[::-1] and g == g[::-1] and s == s[::-1]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys

s = input()
half = int( (len(s)-1) / 2 ) + 1
# print(s)

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

if s1 == s2:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()

N = len(S)
S_list = [i for i in S]
check = 0

S_0 = S_list
for i in range(len(S_0)//2):
    if S_0[i] != S_0[-(i+1)]:
        check = 1

S_1 = S_list[:(N-1)//2]
for i in range(len(S_1)//2+1):
    if S_1[i] != S_1[-(i+1)]:
        check = 1

S_2 = S_list[(N+3)//2-1:]
for i in range(len(S_2)//2+1):
    if S_2[i] != S_2[-(i+1)]:
        check = 1

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

Submission status: Accepted

Solution code:
def kaibun(s):
    #print('[debug]',s)

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

def main():
    S = input()
    N = len(S)
    if kaibun(S) == False:
        #print('[debug]','if 1')
        print('No')
        return

    if kaibun(S[0:(N-1)//2]) == False:
        #print('[debug]','if 2')
        print('No')
        return
    if kaibun(S[(N+3)//2 - 1:N]) == False:
        #print('[debug]','if 3')
        print('No')
        return

    print('Yes')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if not s[0:(n-1)//2]==s[(n+1)//2:n]:
  print('No')
elif s==s[::-1]:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
import math
import re


x=input()

n=len(x)

k=int((n-1)/2)

y=int((n+3)/2)

x1=x[::-1]

x2=x[:k]


x3=x2[::-1]

x4=x[y-1:]
x5=x4[::-1]


if (x1==x)and(x3==x2)and(x4==x5):
    print('Yes')
else :
    print('No')

Submission status: Accepted

Solution code:
S=input()
k=0
d=0
p=0
for i in range(0,len(S)):
    if S[i]==S[len(S)-i-1]:
        k=k
    else:
        k=k+1
for i in range (0,(len(S)-1)//2):
    if S[i]==S[(len(S)-1)//2-i-1]:
        d=d
    else:
        d=d+1
for i in range (0,(len(S)-1)//2):
    if S[(len(S)+3)//2+i-1]==S[len(S)-i-1]:
        p=p
    else:
        p=p+1
if k>0 or d>0 or p>0:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import sys
import math
from functools import reduce
from operator import mul
sys.setrecursionlimit(10**6)

def InMap(): return list(map(int, sys.stdin.readline().split(' ')))
def In(): return int(sys.stdin.readline())
def InS(): return sys.stdin.readline()

S = InS()[:-1]

N = len(S)
T = S[:(N-1)//2]
if S[:(N-1)//2] == T[::-1]:
    T2 = S[(N+1)//2::]
    if S[(N+1)//2::] == T2[::-1]:
        if T == T2[::-1]:
            print('Yes')
            sys.exit()

print('No')

Submission status: Accepted

Solution code:
s = input()
n = s.__len__()
hn = ((n - 1) / 2).__int__()
qn = (hn / 2).__int__()
ans = 'Yes'
for i in range(hn):
    if s[i] != s[n-1-i]:
        ans = 'No'
for i in range(qn):
    if s[i] != s[hn-1-i]:
        ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
S=str(input())
def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return print('No')
    for j in range(len(kaibun)//4):
        if kaibun[j] != kaibun[-(j+len(kaibun)//2)-2]:
            return print('No')
        if kaibun[j+len(kaibun)//2+1] != kaibun[-(j+len(kaibun)//2)-2]:
            return print('No2')
    return print('Yes')

is_kaibun(S)

Submission status: Accepted

Solution code:
s = str(input())
n = int(len(s))
out = 'Yes' if s == s[::-1] and s[:int((n - 1)/2)] == s[:int((n - 1)/2)][::-1] \
               and s[int((n + 3)/2) - 1:n] == s[int((n + 3)/2) - 1:n][::-1] else 'No'
print(out)

Submission status: Accepted

Solution code:
S = input()
N = len(S)
end = int((N-1)/2)
start = int( (N+3)/2)-1

ans  = 'No'
if S == S[::-1]:
    if S[:end] == S[:end][::-1]:
        if S[start:] == S[start:][::-1]:
            ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
import sys

s = input()

n = len(s)

n1 = int(n/2)

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

n2 = int((n-1)/2) - 1

for i in range(n2):
    if s[i] == s[n2-i]:
        pass
    else:
        print('No')
        sys.exit()

n3 = int((n+3)/2)

diff = n-n3

n3 -= 1
n  -= 1

diff = int(diff/2)

for i in range(diff):
    if s[n3+i] == s[n-i]:
        pass
    else:
        print('No')
        sys.exit()

print('Yes')

Submission status: Accepted

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

sr = s[::-1]

s2 = s[:int((n-1)/2)]
#print(s2)
s2r = s2[::-1]

s3 = s[int((n+3)/2)-1:n]
#print(s3)
s3r = s3[::-1]

if (s == sr) and (s2 == s2r) and (s3 == s3r):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
l = len(s)
i = 0
j = l-1
f = 0
while i<j:
	if s[i] != s[j]:
		f = 1
		break
	i += 1
	j -= 1
if f==0:
	i = 0
	j = (l-2)//2
	while i<j:
		if s[i] != s[j]:
			f = 1
			break
		i += 1
		j -= 1
if f==0:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
s = input()

n = len(s)

kai = str()
for i in range(n):
    kai = kai + s[n-1-i]

strong = 0

if kai == s:
    strong = strong + 1

nf = int(((n-1)/2)-1)

kaif = str()
for i in range(nf):
    kaif = kaif + s[nf-i]

if kaif == s[0:nf]:
    strong = strong + 1

ns = int((n+3)/2)

kais = str()
for i in range(n-ns):
    kais = kais + s[n-i-1]

if kais == s[ns-1:n-1]:
    strong = strong + 1

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

Submission status: Accepted

Solution code:
def solve(s):
    def isPalindrome(s):
        return s == s[::-1]

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

s = input()
solve(s)

Submission status: Accepted

Solution code:
def x(S):
	SS = ""
	for i in range(len(S)):

		SS += S[(i+1)*-1]
	return  SS == S

S1 = input()
N1 = len(S1)

N2 = (N1 - 1) // 2
N3 = (N1 + 3) // 2
S2 = S1[0:N1]
S3 =S1[N3-1:N1]
if x(S1) and x(S2) and x(S3):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:

s = input()

answer = "No"

s1= s[:int((len(s)-1)/2)]
s2 = s[int((len(s)+3)/2)-1:]
def check(s): return True if s == s[::-1] else False
if check(s) and check(s1) and check(s2):
    answer = "Yes"
print(answer)

Submission status: Accepted

Solution code:
S = input()

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

if check(S) and check(S[0:int(len(S) / 2)]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
S = input()

N = len(S)
end_index = int((N-1)/2)
temp = S[0:end_index]
#print(temp)
start = int((N+3)/2-1)
end = N+1
temp2 = S[start:end]
#print(temp2)

temp0 = S
if temp0 == temp0[::-1]:
    if temp == temp[::-1]:
        if temp2 == temp2[::-1]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
def resolve():
    S = input()
    N = len(S)
    s1 = S[:(N-1)//2]
    s2 = S[((N+3)//2-1):]

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
S = str(input())

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

N = len(S)

a = pal(S)
k = int((N-1)/2)
b = pal(S[:k])
l = int((N+3)/2-1)
c = pal(S[l:])
if a and b and c:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def p(s):
    rev=''.join(reversed(s))
    k=0
    if(s==rev):
        k=1
    return k
s=input()
n=len(s)
if(p(s)==1 and p(s[:(n-1)//2])==1 and p(s[((n+3)//2)-1:])==1):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
def ispalindrome(s):
    for i in range(len(s)//2):
        if s[i] != s[~i]:
            return False
    return True
if ispalindrome(s) and ispalindrome(s[:len(s)//2]) and ispalindrome(s[len(s)//2+1:]):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

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


S = i_s()
N = len(S)

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


if not ispalindrome(S[:int((N-1)/2)]):
    print('No')
    exit()

if not ispalindrome(S[int(((N+3)/2-1)):]):
    print('No')
    exit()

print('Yes')

Submission status: Accepted

Solution code:
S = input().rstrip()
N = len(S)
if S == S[::-1] and \
        S[:int((N - 1) / 2)] == S[:int((N - 1) / 2)][::-1] and \
        S[int((N + 3) / 2) - 1:N] == S[int((N + 3) / 2) - 1:N][::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
N = int(len(S))
A = "Yes"
n = N//2
m = n//2
 
for i in range(n):
  if S[i] != S[N-1-i]:
    A = "No"
    break
for i in range(m):
  if S[i] != S[n-1-i] or S[n+1+i] != S[N-1-i]:
    A = "No"
    break
print(A)