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 = list(str(input()))

req1 = int((len(S) - 1) / 2)
req2 = int((len(S) + 3) / 2) - 1
if S == list(reversed(S)) and S[:req1] == list(reversed(S[:req1])) and S[req2:] == list(reversed(S[req2:])):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S=input()
n=len(S)
left=int((n-1)/2)
right=int((n+3)/2)
#rint(right)
cnt=0
for a, b in zip(S[:left], reversed(S[left+1:])):
  #print(a,b)
  if a == b: 
    cnt += 1
if cnt==left:
  flag=1

  cnt=0
  for a, b in zip(S[right-1:], reversed(S[:n])):
    #print(a,b)
    if a == b: 
      cnt += 1
    #print(cnt)

  if cnt== left:
    print('Yes')
    exit() 
print("No")

Submission status: Accepted

Solution code:
S = input()

def kaibunChecker(string):
    if string == string[::-1]:
        return True
    else :
        return False
    
flag = False
N = len(S)

if kaibunChecker(S):
    s_front = S[0:(N-1)//2]
    if kaibunChecker(s_front):
        s_end = S[(N+2)//2]
        if kaibunChecker(s_end):
            flag = True

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys

sys.setrecursionlimit(10 ** 6)


def main():
	s = sys.stdin.readline().rstrip()
	n = len(s)
	front = s[:(n-1)//2]
	end = s[(n+3)//2-1:]
	if len(front) % 2 == 0:
		ff = front[:len(front)//2]
		fe = front[len(front)//2:]
	else:
		ff = front[:len(front)//2]
		fe = front[len(front)//2+1:]
	if len(end) % 2 == 0:
		ef = end[:len(end)//2]
		ee = end[len(end)//2:]
	else:
		ef = end[:len(end)//2]
		ee = end[len(end)//2+1:]
	if front == end[::-1] and ff == fe[::-1] and ef == ee[::-1]:
		print("Yes")
	else:
		print("No")

main()

Submission status: Accepted

Solution code:
s = input()

def kaibun(word):
  return word[::-1] == word
ans_1 = str(kaibun(s))

n = len(s)
k_2 = int(((n-1) / 2))
w = [c  for c in s]
ww = []

for j in w:
  ww.append(j)
  if len(ww) == k_2:
    break
ans_2 = str(kaibun(ww))

w_2 = [d for d in s]
www = w_2[::-1]
n_2 = len(www)
k_3 = int(n_2-(n_2+3) / 2 +1)
ww_2 = []
for m in www:
  ww_2.append(m)
  if len(ww_2) == k_3:
    break
ans_3 = str(kaibun(ww_2))

if ans_1 == 'True' and ans_2 == 'True' and ans_3 == 'True':
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

n = len(s)
l = int((n-1)/2)
b = int((n+3)/2)

for i in range(l - int(l/2)):
    if not s[i] == s[l-1-i]:
        print('No')
        exit()

for i in range(n-b - int((n-b)/2)):
    if not s[b-1+i] == s[n-1-i]:
        print('No')
        exit()

for i in range(int(n/2)):
    if not s[i] == s[n-1-i]:
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(S: str):
    N = len(S)
    a = S[0:int((N-1)/2)]
    b = S[int((N+3)/2)-1:N]
    if a == b[::-1]:
        Na = len(a)
        if Na % 2 == 0:
            aa = a[0:int(Na/2)]
            ab = a[int(Na/2):Na]
        else:
            aa = a[0:int((Na - 1) / 2)]
            ab = a[int((Na + 3) / 2)-1:Na]
        Nb = len(b)
        if Nb % 2 == 0:
            ba = b[0:int(Nb/2)]
            bb = b[int(Nb/2):Nb]
        else:
            ba = b[0:int((Nb - 1) / 2)]
            bb = b[int((Nb + 3) / 2)-1: Nb]
        if aa == ab[::-1] and ba == bb[::-1]:
            print(YES)
        else:
            print(NO)
        return
    print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = str(input())
new_S = ''.join(list(reversed(S)))
N = len(S)
def check(n,r,s):
    for _ in range(int((r-n)/2 + 1)):
        S = list(s)
        if S[n] != S[r]:
            return("No")
        else:
            n += 1
            r -= 1
    return("Yes")
ans = 0
if S == new_S:
    ans += 1
if check(0,int((N-1)/2)-1,S) == "Yes":
    ans += 1
if check(int((N+3)/2)-1,N-1,S) == "Yes":
    ans += 1
if ans == 3:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
def is_anagram(s):
    return s == s[::-1]
S = input()
N = len(S)
if not is_anagram(S):
    print('No')
    sys.exit()
cond1 = int(((N-1)/2))
cond1 = S[0:cond1]
cond2 = int(((N+3)/2)-1)
cond2 = S[cond2:]
if is_anagram(cond1) and is_anagram(cond2):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  s = input()
  
  if not is_kaibun(s):
    return 'No'
  if not is_kaibun(s[:len(s)//2]):
    return 'No'
  if not is_kaibun(s[(len(s)+3)//2-1:]):
    return 'No'
  
  return 'Yes'

def is_kaibun(value):
  temp = 0 if len(value) % 2 == 0 else 1
  if value[:len(value)//2] == ''.join(list(reversed(value[len(value)//2+temp:]))):
    return True
  return False
    

print(main())

Submission status: Accepted

Solution code:
kaibun = input()

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

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

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

Submission status: Accepted

Solution code:
def isPal(arr):
    resp = True
    for i in range(0, int(len(arr) / 2)):
        if arr[i] != arr[len(arr) - i - 1]:
            resp = False
            break
    return(resp)

str = input()
resp = 'No'
if isPal(str):
    if isPal(str[0:(len(str) // 2)]) and isPal(str[(len(str) // 2) + 1:len(str)]):
        resp = 'Yes'
print(resp)

Submission status: Accepted

Solution code:
sen=input()
n=len(sen)
def func(arg):
  n=len(arg)
  if len(arg)%2==0:
    maemae=arg[:int(n/2)]
    usiusi=arg[int(n/2):]
    if maemae[::-1]!=usiusi:
      return False
    else:
      return True
  else:
    maemae=arg[:n//2]
    #aidaaida=arg[n//2]
    usiusi=arg[n//2+1:]
    if maemae[::-1]!=usiusi:
      return False
    else:
      return True


mae=sen[:n//2]
#aida=sen[n//2]
usiro=sen[n//2+1:]
if mae[::-1]!=usiro:
    print('No')
else:
  #if func(mae)+func(usiro)==2:
  if func(mae)==1:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
import math
s = str(input())

n = len(s)
k1 = math.ceil((n+1)/2)
sr1 = s[::-1]

s2 = s[0:int(k1-1)]
n2 = len(s2)
k2 = math.ceil((n2+1)/2)
sr2 = s2[::-1]


if s[0:int(k1-1)] == sr1[0:int(k1-1)] and s2[0:int(k2-1)] == sr2[0:int(k2-1)]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
print("Yes" if (lambda x: x==''.join(list(reversed(x))) and x[0:len(x)//2]==''.join(list(reversed(x[0:len(x)//2]))) and x[len(x)-len(x)//2:len(x)]==''.join(list(reversed(x[len(x)-len(x)//2:len(x)]))))(input()) else "No")

Submission status: Accepted

Solution code:
s = input()
sl = list(s)

slen = len(sl)
ans = 1

second = int((slen - 1) / 2)
third = int((slen + 3) / 2)

for i in range(slen):
    if (sl[i] == sl[-1 - i]):
        continue
    else:
        ans = 0

if (ans == 1):
    for i in range(second):
        if (sl[i] == sl[second - i - 1]):
            continue
        else:
            ans = 0

j = -1
if (ans == 1):
    for i in range(third, slen):
        j = j + 1
        if (sl[i - 1] == sl[-1 - j]):
            continue
        else:
            ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# This file is a "Hello, world!" in Python language by CPython for wandbox.
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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 (left_left == left_right[::-1]) and (right_left == right_right[::-1]):
    #     print('Yes')
    # else:
    #     print('No')
    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')

Submission status: Accepted

Solution code:
# coding: utf-8

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")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#  --*-coding:utf-8-*--


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')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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'

Submission status: Accepted

Solution code:
#200322B
S = str(input())
N = len(S)
#print(N)
n = (N-1)//2
#print(n)
#print(type(n))
Sa = S[:n]
#print(Sa)
Sb = S[n+1:]
#print(Sb)


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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
#input = sys.stdin.readline

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()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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