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(input())
A = []
B = []
Triger = 0

if len(S) == 3:
  if S[0] == S[2]:
    print("Yes")
  else:
    print("No")
else:
  for i in range(0,int((len(S)-1)/2)):
    A.append(S[i])
  for j in range(int((len(S)+3)/2-1),len(S)):
    B.append(S[j])
    
  for k in range(len(S)//2):
    if S[k] == S[len(S)-k-1]:
      continue
    else:
      Triger = 1
      break
  for i in range(len(A)//2):
    if A[i] == A[len(A)-i-1]:
      continue
    else:
      Triger = 1
      break
  for j in range(len(B)//2):
    if B[j] == B[len(B)-j-1]:
      continue
    else:
      Triger = 1
      break
  if Triger == 0:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
def is_Palindrome(S):
    T=""
    for s in S:
        T=s+T

    return T==S

S=input()
L=len(S)
if is_Palindrome(S) and is_Palindrome(S[:(L-1)//2]) and is_Palindrome(S[(L-1)//2+1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
s_r = s[::-1]
n = len(s)
a = int((n-1)//2)
f = s[:a:1]
b = s[:a:-1]
b = b[::-1]

if s == s_r and f == b:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()
ans = 1
for i in range(len(s)//2):
    if s[i] != s[-1-i]:
        ans = 0
        break
for i in range(len(s)//2//2):
    if s[i] != s[len(s)//2-1-i]:
        ans = 0
if ans == 0:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
# 文字数の処理があるからlenで長さとる
n = len(s)
# 半分までがleft
sl = s[:n//2]
# 半分+1(中央を飛ばしてから)を始点としてright（奇数だから）
sr = s[n//2+1:]
# 範囲を全指定にしてマイナスステップにすると、要素がリバースする。
# 右半分が回文で左も一緒なら強い回文と言える
if sl == sr and sr ==  sr[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

n = len(s)

l = s[:int((n)/2)]
r = s[int((n)/2)+1:]


if l != r:
    print("No")
    exit()

lr = l[::-1]
rr = r[::-1]

if lr != l or rr != r:
    print("No")
    exit()

print("Yes")

Submission status: Accepted

Solution code:
import sys
s = input()
c= 0
for i in range((len(s))//2):
    if (s[i] != s[(len(s)-1)//2-i-1]) or (s[(len(s)-1)//2+i+1] != s[len(s)-i-1]) or s[i]!=s[len(s)-i-1]:
        c = 0
        break
    else:
        c +=1

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

Submission status: Accepted

Solution code:
a = input()
an = len(a)
dan = an//2

if a[:dan] == a[dan+1:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

judg=True
for i in range(len(S)):
    if not S[i]==S[len(S)-i-1]:
        judg=False
        break
if judg==False:
    print('No')
else:
    for i in range(int((len(S)-1)/2)):
        if not S[i]==S[int((len(S)-1)/2)-1-i]:
            judg=False
            break
    if judg==True:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
def is_palindrome(s):
    n = len(s)
    ok = True
    for i in range(n):
        if s[i] != s[n-i-1]:
            ok = False
    if ok: return True
    else: return False

s = input()
n = len(s)
h = (n-1) // 2
sa = s[0:h]
sb = s[h+1:n]
if is_palindrome(s) and is_palindrome(sa) and is_palindrome(sb):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

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

s_reverse = s[::-1]

s_first = s[:a]
s_first_reverse = s_first[::-1]

s_second = s[b-1:]
s_second_reverse = s_second[::-1]

if s == s_reverse and s_first == s_first_reverse and s_second == s_second_reverse:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
import sys
L=list(input())
N=len(L)
R=N//2
for i in range(R):
  if L[i]!=L[N-1-i]:
    print("No")
    sys.exit()
  elif L[i]!=L[R-1-i]:
    print("No")
    sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
a = str(input())
b = len(a)
c = int((b-1)/2)
d = int((b+3)/2)

g = a[:c]
h = a[d-1: ]
R = list(reversed(a))
P = ''.join(R)
C = []

for i in range(int(len(g)+1)):
    if i!=0:
        G = g[int(-i)]
        C.append(G)
    


W = []

for I in range(int(len(h)+1)):
    if I!=0:
        H = h[int(-I)]
        W.append(H)
N = ''.join(C)
M = ''.join(W)
if N ==g  and M ==h and a == P :
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

import sys
sys.setrecursionlimit(300000)

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

def solve(S: str):
    N = len(S)
    for i in range(N // 2):
        if S[i] != S[N - i - 1]:
            print(NO)
            return NO
    m = N // 2
    for i in range(m // 2):
        if S[i] != S[m - i - 1]:
            print(NO)
            return NO

    print(YES)
    return

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())
m = s[::-1]
n = len(s)
c=0
for i in range(int((n-1)/2)):
    if (s[i]!=m[i]):
        print("No")
        c=1
        break

if c==0:
    a = s[:int((n-1)/2)]
    b = s[int((n+1)/2):]
    x = a[::-1]
    y = b[::-1]
    # print(a)
    # print(b)

    l = (n+1)/4
        # print(l)

    for i in range(int(l)):
        if (a[i]!=x[i])or (b[i]!=y[i]):
            print("No")
            c =1
            break
    if(c==0): 
        print("Yes")

Submission status: Accepted

Solution code:
s = input()
def kaibunn(a):
  for i in range(len(a)//2):
    if not a[i] == a[-1-i]:
      return 0
  return 1
n =len(s) 
if kaibunn(s) == 1 and kaibunn(s[:(n-1)//2]) == 1 and kaibunn(s[(n+3)//2-1:])==1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def is_palindrome(s):
    if len(s) > 1:
        i = 0
        n = len(s)-1
        while s[i] == s[n]:
            i += 1
            n -= 1
            if i >= n:
                break
        else:
            return False
        return True
    else:
        return True

s = input()
n = len(s)

if is_palindrome(s) and is_palindrome(s[0:(n-1)//2]) and is_palindrome(s[(n+3)//2-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:0]
if S==S[::-1] and a==a[::-1] and b==b[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
a = s[:(len(s)-1)//2]
b = s[(len(s)+3)//2-1:]
c1 = s == s[::-1]
c2 = a == a[::-1]
c3 = b == b[::-1]
if all((c1, c2, c3)):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


flag = 1
for i in range(0,(n-1)//2):
    if(i <= (n-1)/2):
        if(s[i] != s[n-i-1] or s[i] != s[(n-1)//2-i-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):
    if S[i]!=S[N-i-1]:
        ans = 'No'
        break

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

for i in range((N+3)//2,N):
    if S[i]!=S[N-i-1]:
        ans = 'No'
        break
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

N = len(S)

S_2 = S[:(N-1)//2]
S_3 = S[(N+3)//2 - 1:N]

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

Submission status: Accepted

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

ans = "Yes"

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

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

for x in range(0, (N-1)//2):
    if S[(N-1)//2 + 1 + x] != S[N-1-x]:
        ans = "No"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
reverse_s=s[::-1]
n=len(s)
s2=s[:(n-1)//2]
reverse_s2=s2[::-1]
s3=s[(n+3)//2-1:]
reverse_s3=s3[::-1]

if reverse_s==s and reverse_s2==s2 and reverse_s3==s3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
s = list(input())
front, back = list(), list()

repeat = (len(s)-1) // 2
for i in range(repeat):
    if s[i] == s[len(s)-1-i]:
        front.append(s[i])
        back.append(s[len(s)-1-i])
    else:
        print('No')
        sys.exit()

if len(front) % 2 == 0:
    repeat = len(front) // 2
else:
    repeat = (len(front)-1) // 2        

for i in range(repeat):
    if front[i] == front[len(front)-1-i] and back[i] == back[len(back)-1-i]:
        pass
    else:
        print('No')
        sys.exit()
        
print('Yes')

Submission status: Accepted

Solution code:
def resolve():
    s = input()

    n = len(s)
    left = s[:(n-1)//2]
    right = s[(n+3)//2-1:]

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

    if is_palindrome(left) and is_palindrome(right) and is_palindrome(s):
        print('Yes')
    else:
        print('No')
resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
palindrome = True
for i in range(int(n/2)):
    if s[i] != s[n-1-i]:
        palindrome = False
        break

doublePalindrome = True
for i in range(int(n/4)):
    if s[i] != s[int(n/2)-1-i] or s[int(n/2)+1+i] != s[n-1-i]:
        doublePalindrome = False
        break

if palindrome and doublePalindrome:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
a=input()
#b=reversed(a)
c=a[0:int((len(a)-1)/2)]
b=''.join(list(reversed(a)))
d=a[int((len(a)+3)/2)-1:]
 
if a!=b:
  print("No")
elif c!=d:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
a=input()
#b=reversed(a)
c=a[0:int((len(a)-1)/2)]
b=''.join(list(reversed(a)))
d=a[int((len(a)+3)/2)-1:]

if a!=b:
  print("No")
elif c!=d:
  print("No")
else:
  print("Yes")

Submission status: Accepted

Solution code:
S = input()

N = len(S)
F = S[0 : N//2]
B = S[N//2+1 : N+1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
T = True
if S != S[::-1]:
    T = False
SS = S[0:int((N - 1) / 2)]
if SS != SS[::-1]:
    T = False
SSS = S[int((N + 3) / 2) - 1:]
if SSS != SSS[::-1]:
    T = False
if T:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

m = []
for i in s:
  m.append(i)
n = len(s)
n1 = int((n-1)/2)
n2 = int((n+3)/2)
ans = 0

for i in range(n1):
  if m[i] != m[n-1-i]:
    print('No')
    break
  else:
    if m[i] != m[n1-1-i]:
      print('No')
      break
    else:
      if m[n2-1+i] != m[n-1-i]:
        print('No')
        break
      else:
        ans += 1
        
if ans == n1:
  print('Yes')

Submission status: Accepted

Solution code:
S = input()

def func(S):
    mid = 0
    if len(S)%2 == 0:
        mid = len(S)//2-1
        #2
        for i in range(mid+1):
            if S[i] != S[-i-1]:
                return False
        for i in range(mid//2+1):
            if S[i] != S[mid-i]:
                return False
        for i in range(len(S)//4+1): 
            if S[mid+1+i] != S[-i-1]:
                return False
        return False
    else:
        mid = len(S)//2
        #3
        for i in range(mid+1):
            if S[i] != S[-i-1]:
                return False
        for i in range(mid//2+1):
            if S[i] != S[mid-i-1]:
                return False
        for i in range(len(S)//4+1): 
            if S[mid+1+i] != S[-i-1]:
                return False
        return True

if func(S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
rvs_s = s[::-1]

left_s = s[:(len(s)-1)//2]
rvs_left_s = left_s[::-1]

right_s = s[(len(s)+3)//2-1:]
rvs_right_s = right_s[::-1]

if s == rvs_s and left_s == rvs_left_s and right_s == rvs_right_s:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = (len(s)-1)//2
print('Yes' if s[:n]==s[n+1:] else 'No')
# 例えば 'abcdabc' でも 'Yes' になるけど大丈夫ですかこれ？

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
def rev(s):
  return ''.join(list(reversed(s)))
N = len(s)
f = s[:int((N-1)/2)]
l = s[int((N+3)/2-1):]
if s == rev(s) and f == rev(f) and l == rev(l):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def kai(str):
  if str==str[::-1]:return True
  else:return False
s=input()
print('Yes' if kai(s) and kai(s[:(len(s)-1)//2]) else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
SF_num = int((N-1)/2)
SF = S[:SF_num]
SF_rev = SF[::-1]
SB_num = int((N+3)/2)
SB = S[SB_num-1:]
SB_rev = SB[::-1]

if SF == SB_rev and SF == SF_rev and SB == SB_rev:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
ok = 1
if S != "".join(list(reversed(S))):
    ok = 0

if S[:(N - 1) // 2] != "".join(list(reversed(S[:(N - 1) // 2]))):
    ok = 0

if S[(N + 2) // 2:] != "".join(list(reversed(S[(N + 2) // 2:]))):
    ok = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_palindrome(string):
  return True if string==string[::-1] else False
  
S = input()

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

ans = 'No' 
if is_palindrome(S) and is_palindrome(S[:a]) and is_palindrome(S[b:]):
  ans = 'Yes' 

print(ans)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
S = str(input())
n = len(S)
k = n // 2
s1 = S[:k]
s2 = S[-k:]
if S == S[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = str(input())
#s = 'bakasakab'
x = len(s)

ck = 1
for i in range(x//2):
  if not s[i] == s[x-i-1]:
    ck = 0
    break
  if not s[i] == s[(x-1)//2-i-1]:
    ck = 0
    break
  if not s[i] == s[(x+3)//2+i-1]:
    ck = 0
    break

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

Submission status: Accepted

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

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


if kaibun(s):
    if kaibun(s[:int((n-1)/2)]):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
def kaibun(A):
    check=1
    for i in range(len(A)//2):
        if A[i]==A[-(i+1)]:
            pass
        else:
            check=check*0
            break
    return check

N=input()
a=kaibun(N)
B=N[0:(len(N)-1)//2]
C=N[(len(N)+3)//2-1:len(N)]
b=kaibun(B)
c=kaibun(C)
if a==1 and b==1 and c==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import math
s = input()
n = len(s)
zen_c = 0
kou_c = 0
z = math.floor((n-1)/2)
k = math.floor((n+2)/2)
zenhan = s[0:z]
kouhan = s[k:n]
zen_l = len(zenhan)-1
for i in range(0, math.floor((zen_l+1)/2)):
  if zenhan[i] == zenhan[zen_l-i] and i != (zen_l-i):
    zen_c += 1
print('Yes' if zen_c == math.floor(z/2) and zenhan == kouhan else 'No')

Submission status: Accepted

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

if S == S[::-1]:
    ans += 1

i = (N-1) // 2
if S[:i] == S[:i:-1]:
    ans += 1

j = (N+3) // 2 - 1
if S[j:] == S[N:j-1:-1]:
    ans += 1

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

Submission status: Accepted

Solution code:
s=input()
sl=list(reversed(s))
ns="".join(list(reversed(s)))
k=int((len(s)-1)/2)
t=s[:k]
tl=list(reversed(t))
nt="".join(list(reversed(t)))
n=int((len(s)+3)/2)
r=s[n-1:len(s)]
rl=list(reversed(r))
nr="".join(rl)
if s==ns and t==nt and r==nr:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

flag = True

def check(s):
    return s == s[::-1]
    
if not check(s):
    flag = False
    
if not check(s[:len(s)//2]):
    flag = False
    
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
t = (n-1)//2
a = s[0:((n-1)//2)]

b = s[n//2 + 1:]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
S = input()

def isKaibun(txt, n):
    for i in range(n):
        if txt[i] == txt[-(i+1)]:
            continue
        else:
            print("No")
            sys.exit()
    return 0

l = len(S)
isKaibun(S, l//2)

l_b = (l-1)//2 
isKaibun(S[:l_b], l_b//2)

l_a = (l+3)//2
isKaibun(S[l_a-1:], (l-l_a)//2)

print("Yes")

Submission status: Accepted

Solution code:
import math
s = str(input())
m = (len(s) - 1) / 2
c = True
for i in range(math.floor(m / 2)):
    if s[i] != s[int(m-1-i)]:
        c = False
for i in range(math.floor(m / 2)):
    if s[int(m+1+i)] != s[int(len(s)-1-i)]:
        c = False
for i in range(math.floor(m)):
    if s[i] != s[int(math.floor(len(s)-1-i))]:
        c = False
if c:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

def is_kaibun(st):
    return len(st) == 1 or st[:len(st) // 2] == st[-(len(st) // 2):][::-1]

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

Submission status: Accepted

Solution code:
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import cmath as cma
import copy as cp
import sys
def sinput(): return sys.stdin.readline().strip()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(n=0):
    if n: return [0 for _ in range(n)]
    else: return list(imap())
def farr(): return list(fmap())
def sarr(n=0):
    if n: return ["" for _ in range(n)]
    else: return sinput().split()
def barr(n): return [False for _ in range(n)]
sys.setrecursionlimit(10**7)
MOD = 10**9 + 7; EPS = sys.float_info.epsilon
PI = np.pi; EXP = np.e; INF = np.inf

s = sinput()
n = len(s)

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


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

Submission status: Accepted

Solution code:
s = list(input())

thresh_1 = int((len(s) - 1) / 2)
thresh_2 = int((len(s) + 3) / 2)

s_1 = s[:thresh_1]
s_2 = s[thresh_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)
def check(s):
  return "".join(reversed(s)) == s
#print(S, S[:(N-1)//2], S[(N+1)//2:])
if check(S) and check(S[:(N-1)//2]) and check(S[(N+1)//2:]):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

s = input()
s_len = len(s)
flag1 = isKaibun(s)
flag2 = isKaibun(s[:(s_len-1) // 2])
flag3 = isKaibun(s[(s_len+2) // 2:])
if flag1 and flag2 and flag3:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

S1 = S[:(N-1)//2]
S2 = S[(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:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product#accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque
def run():
    S = input()
    N = len(S)
    if S[:(N-1)//2] == S[:(N-1)//2][::-1] and S == S[::-1] and S[(N+3)//2-1:] == S[(N+3)//2-1:][::-1]:
        print('Yes')
    else:
        print('No')
if __name__ == "__main__":
    run()

Submission status: Accepted

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

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

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


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

Submission status: Accepted

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

c=list(a)
d=list(reversed(c))

e=list(b)
f=list(reversed(e))

if a==b and c==d and e==f:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()

n=len(s)

a=s[::-1]

mae=(a[0:int((n-1)/2)])

maer=(mae[::-1])

ato=(a[int((n+2)/2):])

ator=(ato[::-1])

if a==s :
    if mae==maer and ato==ator:
        print("Yes")
    else :
        print("No")
        

else :
    print('No')

Submission status: Accepted

Solution code:
S = input()
N = len(S)
left = S[:int(N/2)]
right = S[int((N+2)/2):]

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
left = S[:int(N/2)]
right = S[int((N+2)/2):]
S_reversed = "".join(reversed(list(S)))
left_reversed = "".join(reversed(list(left)))
right_reversed = "".join(reversed(list(right)))

if S == S_reversed and left == left_reversed and right == right_reversed:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
tmp1 = S[:(N-1)//2]
tmp2 = S[(N+3)//2-1:]


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

Submission status: Accepted

Solution code:
s=input()
f=s[:(len(s)-1)//2]
l=s[(len(s)+3)//2-1:]
flag="Yes"
for i in range(len(s)//2):
    if s[i]==s[-i-1]:
        pass
    else:
        flag="No"
        break
if flag=="Yes":
    for j in range(len(f)//2):
        if f[j]==f[-j-1]:
            pass
        else:
            flag="No"
            break
if flag=="Yes":
    for x in range(len(l)//2):
        if l[x]==l[-x-1]:
            pass
        else:
            flag="No"
            break
print(flag)

Submission status: Accepted

Solution code:
# -*- coding: <encoding name> -*-

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

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:
st=input()
n=len(st)
if(n%2==0):
	print("No")
	exit(0)
if(st==st[::-1]):
	s1=""
	for i in range((n-1)//2):
		s1+=st[i]
	s2=""
	for i in range((n+3)//2-1,n):
		s2+=st[i]
	if(s1==s1[::-1] and s2==s2[::-1]):
		print("Yes")
	else:
		print("No")
else:
	print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
n = len(S)
S1 = S[:(n-1)//2]
S2 = S[(n+3)//2-1:]
ans = "Yes"
for i in range(n//2):
	if S[i] != S[-(i+1)]:ans="No"
for i in range(len(S1)//2):
	if S1[i] != S1[-(i+1)]:ans="No"
for i in range(len(S2)//2):
	if S2[i] != S2[-(i+1)]:ans="No"
print(ans)

Submission status: Accepted

Solution code:
S = input()
N = len(S)
S_1 = []
S_2 = []

for i in range(int((N-1)/2)):
    S_1.append(S[i])

for j in range(int((N+3)/2-1), int(N)):
    S_2.append(S[j])

S_2.reverse

if S_1 == S_2 :
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
N = len(S)
def isPalindrome(str):
    return str == str[::-1]

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

Submission status: Accepted

Solution code:
import sys
S = input()
if S != S[::-1]:
  print("No")
  sys.exit()
N = len(S)
SS = S[:(N - 1) // 2]
if SS != SS[::-1]:
  print("No")
  sys.exit()
SSS = S[(N + 3) // 2 - 1:]
if SSS != SSS[::-1]:
  print("No")
  sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc159/tasks/abc159_b
s=input()
n=len(s)
first=int((n-1)/2)
last=int((n+3)/2)

rev_s=s[::-1]
s_first=s[:first]
s_last=s[last-1:]
rev_s_first=s_first[::-1]
rev_s_last=s_last[::-1]

for i in range(len(s_first)):
    if s_first[i]!=rev_s_first[i]:
        print("No")
        exit()

for i in range(len(s_last)):
    if s_last[i]!=rev_s_last[i]:
        print("No")
        exit()

for i in range(n):
    if s[i]!=rev_s[i]:
        print("No")
        exit()

print("Yes")

Submission status: Accepted

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

Sa = S[0:(N-1)//2]
Sb = S[(N+3)//2 -1:]

#print(S, Sa, Sb)

def parind(X):
  T = len(X)
  for i in range(T):
    if X[i] != X[T-i-1]:
      return False
  return True

print('Yes' if parind(S) and parind(Sa) and parind(Sb) else 'No')

Submission status: Accepted

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

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

    k1 = int((N-1)/2)
    k2 = int((N+3)/2)
    if checKPal(S) and checKPal(S[:k1]) and checKPal(S[k2-1:]):
        print("Yes")
    else:
        print("No")

main()

Submission status: Accepted

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

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

Submission status: Accepted

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

#print(S[::-1])

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)
if (s == s[::-1]):
    a = s[:(n-1)//2]
    if (a == a[::-1]):
        b = s[(n+3)//2-1:]
        if (b == b[::-1]):
            print("Yes")
            quit()
print("No")