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)
flag = True
if S != S[::-1]:
    flag = False
SS = S[0:(N-1)//2]
if SS != SS[::-1]:
    flag = False
SS = S[(N+3)//2:-1]
if SS != SS[::-1]:
    flag = False
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def string_palindrome(word):
	word_head = word[:(len(word)-1)//2]
	word_last = word[((len(word)+3)//2)-1:]
	if word != word[::-1]:
		return 'No'
	elif word_head == word_head[::-1] and word_last == word_last[::-1]:
		return 'Yes'
	else:
		return 'No'

print(string_palindrome(input()))

Submission status: Accepted

Solution code:
S = input()
N = len(S)
res = "No"

if S == S[::-1]:
    if S[:int((N-1)/2)] == S[:int((N-1)/2)][::-1]:
        if S[int((N+3)/2)-1:] == S[int((N+3)/2)-1:][::-1]:
            res = "Yes"

print(res)

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[::-1] == S and a == a[::-1] and b == b[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def isReverse(s):
    p1 = 0
    p2 = len(s) - 1
    flag = True
    while p1 <= p2:
        if s[p1] != s[p2]:
            flag = False
        p1 += 1
        p2 += -1
    return flag
if __name__ == "__main__":
    s = input()
    s1 = s[:int((len(s) - 1) / 2)]
    s2 = s[int((len(s) + 1) / 2):]
    # print(s, s1, s2)
    # print(isReverse(s), isReverse(s1), isReverse(s2))
    if isReverse(s) and isReverse(s1) and isReverse(s2):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

def solve(word, length):

    first = (length-1) // 2
    last = (length+3) // 2
    
    if isPalindrome(word) and isPalindrome(s[:first]) and isPalindrome(s[last-1:]):
        print("Yes")
    else:
        print("No")

def isPalindrome(word):
    palindrome = True
    size = len(word)
    start = 0
    end = size - 1

    while start <= end:
        if word[start] != word[end]:
            palindrome = False
            return palindrome
        
        start += 1
        end -= 1
    
    return palindrome

solve(s, length)

Submission status: Accepted

Solution code:
S = list(input())
list1 = S[0:int(((len(S)-1)/2))]
list2 = S[int(((len(S)+3)/2)-1):len(S)]
S_r = list(reversed(S))
list1_r = list(reversed(list1))
list2_r = list(reversed(list2))

if list1 == list1_r and list2 == list2_r and S == S_r:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

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

# print(s[:(len(s)-1)//2])
# print(s[(len(s)+3)//2-1:])

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())

def is_kaibun(_S):
    if len(_S)==1 or _S[:int((len(_S))/2)]==_S[int((len(_S)+1)/2):][::-1]:
        return True
    else:
        return False

def main():
    _S = S()
    is_tsuyoi1 = is_kaibun(_S)
    is_tsuyoi2 = is_kaibun(_S[:int((len(_S)-1)/2)])
    is_tsuyoi3 = is_kaibun(_S[int((len(_S)+1)/2):])
    print("Yes" if is_tsuyoi1 and is_tsuyoi2 and is_tsuyoi3 else "No")


main()

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
N2 = (N-1)//2
N3 = (N+3)//2
ans = 0
Sr = S[::-1]

if(S == Sr):
    ans = 1
    S2 = S[0:N2]
    S2r = S2[::-1]
    if(S2 == S2r):
        S3 = S[(N+3)//2-1:N]
        S3r = S3[::-1]
        if(S3 != S3r):
            ans = 0
    else :
        ans = 0
            
if(ans == 1):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def palindrome(s):
    return s == "".join(list(reversed(s)))

S = input()
N = len(S)

s1 = S[:(N-1)//2]
s2 = S[(N+3)//2 -1:]
print("Yes" if palindrome(s1) and palindrome(s2) and palindrome(S) else "No")

Submission status: Accepted

Solution code:
s = input()
s_h = s[:(len(s)-1)//2]
s_h_b = s[(len(s)+3)//2-1:]

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

Submission status: Accepted

Solution code:
s = input()
t = True

if s == s[::-1]:
  if s[:(int)((len(s) - 1)/2)] == s[:(int)((len(s) - 1)/2):-1]:
    if s[(int)((len(s) + 3)/2 - 1):] == s[-1:len(s) - (int)((len(s) + 3)/2) + 1:-1]:
      print("Yes")
      t = False
if t:
  print("No")

Submission status: Accepted

Solution code:
s = input()
if s == s[::-1]:
    temp = s[0:int(((len(s) - 1) / 2))]
    if temp == temp[::-1]:
        temp = s[int(((len(s) + 3) / 2)) - 1:len(s)]
        if temp == temp[::-1]:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
m=int((n-1)/2)
l=int((n+3)/2)
a=0
#Sは回文の条件
for i in range(n):
    if s[i]!=s[n-i-1]:
        a+=1


for i in range(m):
    if s[i]!=s[m-i-1]:
        a+=1


for i in range(l,n):
    if s[i]!=s[n-i-1]:
        a+=1

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



#a=n+m+(n-l+1)

Submission status: Accepted

Solution code:
S=input()
N=len(S)
T=S[:N//2]
U=S[N//2+1:]

flg=0

for i in range(int((N-1)/2)):
  if(S[i]!=S[-i-1]):
    flg=1
    break
  
for j in range(len(T)//2):
  if(T[j]!=T[-j-1]):
    flg=1
    break
  
for k in range(len(U)//2):
  if(U[k]!=U[-k-1]):
    flg=1
    break

if(flg==0):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

S = input()
flag = 0

if isKaibun(S):
  flag += 1
if isKaibun(S[:(len(S)-1)//2]):
  flag += 1
if isKaibun(S[(len(S)+3)//2-1:]):
  flag += 1

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

Submission status: Accepted

Solution code:
import numpy as np

S = np.array([i for i in input()])
S_rev = S[::-1]
N = len(S)

ans = 'No'

if all(S == S_rev):
  temp_S = S[:(N-1)//2]
  temp_S_rev = temp_S[::-1]
  
  if all(temp_S == temp_S_rev):
    temp_S = S[(N+3)//2-1:]
    temp_S_rev = temp_S[::-1]
    
    if all(temp_S == temp_S_rev):
      ans = 'Yes'
print(ans)

Submission status: Accepted

Solution code:
import math
s = input()

n = len(s)


before = s[:math.floor(n/2)]
after = s[math.ceil(n/2):]
if before == after:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

def kaibun(s):
    if len(s) % 2 == 1:
        l = len(s) //2
        return s[:l] == s[:l:-1]
    else:
        l = len(s) //2
        return s[:l] == s[:l-1:-1]
n = len(s)

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

Submission status: Accepted

Solution code:
def main():
    import sys
    #input = sys.stdin.readline
    s = input()
    n = len(s)
    s_l = s[:int((n-1)/2)]
    s_r = s[int((n+1)/2):]
    if s == s[::-1] and s_l == s_l[::-1] and s_r == s_r[::-1]:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = list(input())

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

if len(S) > 3:
    if len(S)%4 == 1:
        c = 0
        for i in range(0,int((len(S)-1)/4)):
            if S[i] == S[int((len(S)-1)/2)-i-1]:
                c += 1
        d = 0
        for i in range(0,int((len(S)-1)/4)):
            if S[int((len(S)+3)/2)+i-1] == S[len(S)-i-1]:
                d += 1
        if b == int((len(S)-1)/2) and c == int((len(S)-1)/4) and d == int((len(S)-1)/4):
            print('Yes')
        else:
            print('No')
    elif len(S)%4 == 3:
        c = 0
        for i in range(0,int((len(S)-3)/4)):
            if S[i] == S[int((len(S)-1)/2)-i-1]:
                c += 1
        d = 0
        for i in range(0,int((len(S)-3)/4)):
            if S[int((len(S)+3)/2)+i-1] == S[len(S)-i-1]:
                d += 1
        if b == int((len(S)-1)/2) and c == int((len(S)-3)/4) and d == int((len(S)-3)/4):
            print('Yes')
        else:
            print('No')
else:
    if S[0] == S[2]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

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

ans = 0
n = len(s)
s1 = list(reversed(s))
if s != s1:
    ans = 1

s2 = s[0:(n-1)//2]
s3 = list(reversed(s2))
if s2 != s3:
    ans = 1

s4 = s[(n+2)//2:n]
s5 = list(reversed(s4))
if s4 != s5:
    ans = 1

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

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit


def main():
    input = stdin.readline
    s = list(input()[:-1])
    N = len(s)
    if s != list(reversed(s)):
        print('No')
    elif s[0: (N - 1) // 2] != list(reversed(s[0: (N - 1) // 2])):
        print('No')
    elif s[(N + 1) // 2:N] != list(reversed(s[(N + 1) // 2:N])):
        print('No')
    else:
        print('Yes')


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Submission status: Accepted

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

S = input()

allS = isPalindrome(S)
formerS = isPalindrome(S[:len(S)//2])
latterS = isPalindrome(S[len(S)//2+1:])

if allS and formerS and latterS:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
from itertools import *

def main():
    N = input()
    #print(N[::-1])
    #print(N[:(len(N)-1)//2])
    #print(N[(len(N)+3)//2:-1])
    
    if N != N[::-1]:
        print("No")
    elif N[:(len(N)-1)//2] != N[:(len(N)-1)//2][::-1]:
        print("No")
    elif N[(len(N)+3)//2:-1] != N[(len(N)+3)//2:-1][::-1]:
        print("No")
    else:
        print("Yes")

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

def check(c):
    if len(c) == 0:
        return False
    if list(c) == list(reversed(c)):
        return True
    return False

result = "No"
if check(S):
    if check(S[:int((N-1)/2)]):
        if check(S[int((N+3)/2)-1:]):
            result = "Yes"
print(result)

Submission status: Accepted

Solution code:

s=input()
flag=True
n=len(s)
if s!=s[::-1]:
    flag=False
if s[:(n-1)//2]!="".join(list(reversed(s[:(n-1)//2]))):
    flag=False
if s[(n+3)//2-1:]!="".join(list(reversed(s[(n+3)//2-1:]))):
    flag=False
print("Yes" if flag else "No")

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
for ii in range(n//2):
  if s[ii]!=s[n-ii-1]:
    print("No")
    exit()
ss=s[0:n//2]
#print(ss)
nn=len(ss)
for ii in range(nn//2):
  if ss[ii]!=ss[nn-ii-1]:
    print("No")
    exit()
ss=s[(n+3)//2-1:n]
#print(ss)
nn=len(ss)
for ii in range(nn//2):
  if ss[ii]!=ss[nn-ii-1]:
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
S1 = S[:N//2]
S2 = S[N//2 + 1:]
if S1 != S2:
    print('No')
    exit()
for i in range(N//4):
    if S1[i] != S1[-i - 1]:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
S = input()
N = len(S)
S1 = S[:N//2]
S2 = S[N//2 + 1:]
N1 = len(S1)
if S1 != S2:
    print('No')
    exit()

for i in range(N//4):
    if S1[i] != S1[-i - 1]:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

Solution code:
s = str( input() )

n = len( s )
s_l = s[:(n-1)//2]
s_r = s[(n+1)//2:]

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    s1 = list(input())
    rev1 = s1[::-1]
    n = len(s1)
    s2 = s1[0:(n-1)//2]
    rev2 = s2[::-1]
    s3 = s1[(n+3)//2-1:n]
    rev3 = s3[::-1]
    if s1 == rev1 and s2 == rev2 and s3 == rev3:
        print("Yes")
    else:
        print("No")

    return

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
S1 = S[:int((N-1)/2)]
S2 = S[int((N+1)/2) : N]
l = [S, S1, S2]
ans = 'Yes'

for s in l:
  for i in range(len(s)):
    a = s[i]
    b = s[-(i+1)]
    if a != b:
      ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
def f(s):
    n =len(s)
    t = list(s)
    lower = t[:(n-1) // 2]
    upper = t[(n+1) // 2:]
    print('Yes' if t == t[::-1] and lower == lower[::-1] and upper == upper[::-1] else "No")

s = input()
f(s)

Submission status: Accepted

Solution code:
S = input()

N = len(S)
s = S[::-1]
a = S[:((N-1)//2)]
b = S[((N+3)//2)-1:]
c = a[::-1]
d = b[::-1]

if (S == s and a == c):
    if(b == d):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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


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

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

Submission status: Accepted

Solution code:
s = input()
S = list(s)
cnt = 0
l = int(len(s))
l = l // 2
for i in range(l + 1):
    if S[i] == S[-(1 + i)]:
        for j in range(l):
            if S[j] == S[-(l + 2 + j)]:
                cnt += 1


if cnt == l * (l + 1):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
S2 = S[::-1]
if(S != S2):
  print('No')
else:
  N = len(S)
  sl = S[:(N-1)//2]
  sr = S[(N+1)//2:]
  sl2 = sl[::-1]
  sr2 = sr[::-1]
  if(sl == sl2 and sr == sr2):
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
str=input()

N=len(str)

def kaibun(STR):
  n=len(STR)
  for i in range(int((n+1)/2)):
    if STR[i]==STR[n-1-i]:
      pass
    else:
      return False
  return True

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = sr()

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

mid = (len(S)-1) // 2
bl = check(S) and check(S[:mid]) and check(S[mid+1:])

print('Yes' if bl else 'No')

Submission status: Accepted

Solution code:
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = sr()

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

bl = True
if not check(S):
    bl = False
mid = (len(S)-1) // 2
if not check(S[:mid]):
    bl = False
if not check(S[mid+1:]):
    bl = False

print('Yes' if bl else 'No')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
flag = True
for i in range(n):
    if s[i] != s[n-i-1]:
        flag = False

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

n3 = (n + 3) // 2 - 1

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

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

Submission status: Accepted

Solution code:
S = list(input())
S_rev = list(reversed(S))
S_min = list(S[:(len(S) - 1) // 2])
S_min_rev = list(reversed(S_min))


if S == S_rev and S_min == S_min_rev:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

def isKaibun(x):
    if x == x[::-1]:
        return True
    else:
        return False

ans = 'Yes'

if not isKaibun(s):
    ans = 'No'
if not isKaibun(s[:(n-2)//2+1]):
    ans = 'No'
if not isKaibun(s[(n+2)//2:]):
    ans = 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def isp(s):
    t=s[::-1]
    if s==t:
        return 1
    return 0

s=input()
n=len(s)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    s = input()
    ans = True

    for i in range((len(s) - 1) // 2):
        if s[0 + i] != s[(len(s) - 1) // 2 - i - 1] or s[(len(s) + 3) // 2 + i - 1] != s[len(s) - i - 1] or s[0 + i] != s[len(s) - i - 1]:
            ans = False
    if ans:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

if s==rs and a==ra and b==rb:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
a=1
for i in range(0,n//2 -1):
	if s[i]!=s[n//2 -1 -i]:
		a=0
for i in range(n//2 +1,n):
	if s[i]!=s[n + n//2  -i]:
		a=0
for i in range(0,n):
	if s[i]!=s[n-1-i]:
		a=0
if a:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
s = list(input())
n = len(s); flag= 0
if s == s[::-1]:    flag += 1 ;
start, end = 0, ((n-1)//2)-1
while(end > start and flag == 1):
    if not(s[start] == s[end]):        break;
    start += 1 ; end -= 1
else:    flag += 1
start, end = (n+3)//2 -1, (n-1)
while(end > start and flag == 2):
    if not(s[start] == s[end]):        break;
    start += 1 ; end -= 1
else:    flag += 1
print('Yes' if flag == 3 else 'No')

Submission status: Accepted

Solution code:
S = input()
left = S[0:(len(S)-1)//2]
right = S[(len(S)+3)//2 - 1: len(S)]

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

if kaibun(S) and kaibun(left) and kaibun(right):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

S = input()
N = len(S)

flag = 0

# judge of palindrome
for i in range(N//2):
    if S[i] != S[N-i-1]:
        print("No")
        sys.exit()

if N ==3 or N==4:
    print("Yes")
    sys.exit()

# judge of strong palindrome
for i in range(N//4):
    if S[i] != S[N//2-1-i]:
        print("No")
        sys.exit()
    if S[math.ceil(N/2)+i] != S[N-1-i]:
        print("No")
        sys.exit()

print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def strongPalindrome(S):
    S2 = S[0:(len(S)-1)//2]
    S3 = S[(len(S)+3-1)//2:]
    return "Yes" if S == S[::-1] and S2 == S2[::-1] and S3 == S3[::-1] else "No"

S = input()
print(strongPalindrome(S))

Submission status: Accepted

Solution code:
def kaibun(x):
    if x == x[::-1]:
        return True
    return False


s = input()
if kaibun(s) and kaibun(s[:len(s) // 2]) and kaibun(s[len(s) // 2 + 1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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


def is_rev(s):
    return tuple(s) == tuple(reversed(s))


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

Submission status: Accepted

Solution code:

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

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
c = 1
for i in range((n-1)//2):
    c = -c if s[i]==s[n-i-1] else 0

for j in range((n-1)//4):
    c = -c if s[j]==s[(n-1)//2-j-1] else 0

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
sf = s[0:(n-1)//2]
sr = s[::-1][0:(n-1)//2]
print('YNeos'[not(s == s[::-1] and sf == sf[::-1] and sr == sr[::-1])::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check(c):
    f = False
    for i,s in enumerate(c):
        if c[i] != c[-(i+1)]:
            break
        if len(c) % 2 == 0 and i == len(c) / 2:
            f = True
            break
        if len(c) % 2 == 1 and i == (len(c) - 1) / 2:
            f = True
            break
    return f

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

#全体として回文になっているか
if s != s[::-1]:
    print("No")
    exit()

mae = s[:len(s)//2]#前半部分
ushiro = s[(len(s)+1)//2:]#後半部分

#前部分が回文になっているか
if mae != mae[::-1]:
    print("No")
    exit()

#後ろ部分が回文になっているか
if ushiro != ushiro[::-1]:
    print("No")
    exit()

print("Yes")

Submission status: Accepted

Solution code:
S = input()
ok = True

ok &= list(S) == list(reversed(S))
ok &= list(S[:(len(S)-1)//2]) == list(reversed(S[:(len(S)-1)//2]))
ok &= list(S[(len(S)+3)//2-1:]) == list(reversed(S[(len(S)+3)//2-1:]))

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

Submission status: Accepted

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


def isP(s):
    l, r = 0, len(s)-1
    while l < r:
        if s[l] != s[r]:
            return False
        l += 1
        r -= 1
    return True


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

Submission status: Accepted

Solution code:
s = input()

n = len(s)

t = s[0:((n-1)//2)]
u = s[(n+3)//2-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
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

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

Submission status: Accepted

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

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


def is_palindrome(S: str):
    return S == S[::-1]


def solve(S: str):
    N = len(S)
    former = S[:((N-1)//2)]
    latter = S[(((N+3)//2)-1):]
    return all(map(is_palindrome, [S, former, latter]))


def main():
    S = input()  # type: str
    print(YES if solve(S) else NO)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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


def solve(S: str):
    N = len(S)
    is_whole_statement_palindrome = S == S[::-1]
    former = S[:((N-1)//2)]
    is_former_palindrome = former == former[::-1]
    latter = S[(((N+3)//2)-1):]
    is_latter_reversed = latter == latter[::-1]
    return (
        is_whole_statement_palindrome
        and is_former_palindrome
        and is_latter_reversed
    )


def main():
    S = input()  # type: str
    print(YES if solve(S) else NO)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
s2 = s.copy()
s2.reverse()
n = len(s)
k = int((n-1) /2)

if s != s2:
    print("No")
else:
    first = s[:k]
    first2 = first.copy()
    first2.reverse()
    second = s[k+1:]
    second2 = second.copy()
    second2.reverse()
    if first == first2 and second == second2:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter
# a.sort(key=itemgetter(i)) # i番目要素でsort
from functools import lru_cache
# @lru_cache(maxsize=None)
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))

def NO():
    print("No")
    exit()
s = list(input())[:-1]
n=len(s)
for i in range(n // 2):
    if s[i] != s[-i - 1]:
        NO()
end=(n-1)//2
for i in range(end//2):
    if s[i] != s[end - i - 1]:
        NO()
begin = (n + 3) // 2
for i in range(begin, (n - begin) // 2):
    if s[i] != s[-i - 1]:
        NO()
print("Yes")

Submission status: Accepted

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

def palindrome(i):
    if i == i[::-1]:
        return True

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

if palindrome(s) and palindrome(s_1) and palindrome(s_2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
 
l = int((len(s)-1)/2)

s1 = s[:l]
s2 = s[-l:]

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

Submission status: Accepted

Solution code:
s = input()
l = len(s)
l_half = int((l-1)/2)
isP = True
for i in range(l_half):
    isP *= s[i] == s[l - 1 - i]

for i in range(l_half//2):
    isP *= s[i] == s[l_half - 1 - i]
    isP *= s[l_half + 1 + i] == s[l - 1 - i]
print("Yes" if isP else "No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
S = input()
if S != ''.join(reversed(S)):
    print('No')
elif S[:((len(S)-1)//2)] != ''.join(reversed(S[:((len(S)-1)//2)])):
    print('No')
elif S[((len(S)+3)//2-1):] != ''.join(reversed(S[((len(S)+3)//2-1):])):
    print('No')
else:
    print('Yes')