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())
N=len(s)
a=int((N-1)/2)
b=int((N+1)/2)
if  s[::-1]==s and s[:a]==s[b:]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def palindrome(x):
    reverse = x[::-1]
    for i in range(len(x)):
        if (x[i] != reverse[i]):
            return False
    return True

c = input()
l = len(c)
print(["No","Yes"][palindrome(c) & palindrome(c[:(l-1)//2])& palindrome(c[(l+2)//2:])])

Submission status: Accepted

Solution code:
s = input()
# 1. Sは回文である。
rs = s[::-1]
q1 = 0
if s == rs:
  q1 = 1
# print("q1=",q1)
# 2. Nを Sの長さとするとき、Sの 1文字目から (N−1)/2
#    文字目まで(両端含む)からなる文字列は回文である。
n = len(s)
h = int((n-1)/2)
# print("n,h=",n,h)
s1 = s[:h:]
# print("s1=",s1)
rs1 = s1[::-1]
q2 = 0
if (s1 == rs1):
  q2 = 1
# print("q2=",q2)
# 3. Sの (N+3)/2文字目から N文字目まで
#    (両端含む)からなる文字列は回文である。
n = len(s)
h = int((n+2)/2)
# print("n,h=",n,h)
s2 = s[h::]
# print("s2=",s2)
rs2 = s2[::-1]
q3 = 0
if (s2 == rs2):
  q3 = 1
# print("q3=",q3)
if q1 == 1 and q2 == 1 and q3 ==1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S=str(input())
N=len(S)
n=round((N-1)/2)
s=S[0:n]
bad=0
for i in range(n):
  if s[i] != s[n-i-1]:
    bad = bad + 1
for i in range(round((N-1)/2)):
  if S[i] != S[N-i-1]:
    bad = bad + 1

if bad<1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
# coding: utf-8
s = input()
n = len(s)
for i in range(n//2):
    if s[i] != s[n-1-i]:
        print("No")
        quit()
for i in range(int((n-1)/2//2)):
    if s[i] != s[int((n-1)/2 - 1 - i)]:
        print("No")
        quit()
for i in range(int((n+3)/2-1),n):
    if s[i] != s[n-1-i]:
        print("No")
        quit()
print("Yes")

Submission status: Accepted

Solution code:
s=input()
from collections import deque
def kaibun_search(str):
    d=deque(str)
    while len(d)>1:
        a=d.popleft()
        b=d.pop()
        if a!=b:
            return -1

    return 0

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

Submission status: Accepted

Solution code:
s = input()
lns = len(s)
def is_palindrome(si): return si == si[::-1]
print("Yes" if is_palindrome(s) and is_palindrome(s[:(lns//2)]) and is_palindrome(s[(lns//2)+1:]) else "No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()
for i in range(len(S)//2):
	if S[i] != S[-i-1]:
		print("No")
		exit()
S_front = S[:(len(S)//2)]
for i in range(len(S_front)//2):
	if S_front[i] != S_front[-i-1]:
		print("No")
		exit()
S_back = S[(len(S)+1)//2:]
for i in range(len(S_back)//2):
	if S_back[i] != S_back[-i-1]:
		print("No")
		exit()
print("Yes")

Submission status: Accepted

Solution code:
def IsPalindrome(s):
    reversed = s[::-1]
    for i, j in zip(s, reversed):
        if i != j:
            return False
    return True

def weakOrStrong(s):
    if not IsPalindrome(s):
        return False
    n = len(s)
    if not IsPalindrome(s[:int((n - 1) / 2)]):
        return False
    if not IsPalindrome(s[int((n + 1) / 2):]):
        return False
    return True

def solve(s):
    return 'Yes' if weakOrStrong(s) else 'No'

def main():
    s = input()
    print(solve(s))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
c = True
for i in range (len(S)//2):
  if S[i]==S[len(S)//2-i-1]==S[len(S)//2+1+i]==S[len(S)-i-1]:
    c = True
  else:
    c = False
    break
if (c):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()

is_palindrome = lambda S: S == ''.join(list(reversed(S)))
is_palindrome2 = lambda S: is_palindrome(S[0:int((len(S) - 1) / 2)])
is_palindrome3 = lambda S: is_palindrome(S[int((len(S) + 3) / 2):len(S) - 1])
is_strong_palindrome = lambda S: is_palindrome(S) and is_palindrome2(S) and is_palindrome3(S)

answer = 'Yes' if is_strong_palindrome(S) else 'No'

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
Sl = len(S)
Scenter = int((len(S) - 1) / 2)
for i in range(Scenter):
    if not S[i] == S[len(S) - 1 - i]:
        print("No")
        quit()
for i in range(Scenter // 2):
    if not S[i] == S[Scenter - 1 - i]:
        print("No")
        quit()
for i in range(Scenter // 2):
    if not S[i + 1 + Scenter] == S[len(S) - 1 - i]:
        print("No")
        quit()
print("Yes")

Submission status: Accepted

Solution code:
S = input()
l = len(S)
tf = 1

def check(st):
    l = len(st)
    for i in range(l//2):
        if st[i] != st[l-i-1]:
            return 0
    return 1

if check(S)==check(S[:(l-1)//2])==check(S[(l+3-1)//2:])==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = list(str(input()))
inv = list(reversed(S))
n = len(S)
d = int((n-1)/2)
q = int((n+1)/2)
if S != inv:
    print('No')
else:
    if S[:d] == S[q:]:
        print('Yes')
    else:
        print('No')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


############ ---- Input Functions ---- ############
def in_int():
    return (int(input()))


def in_list():
    return (list(map(int, input().split())))


def in_str():
    s = input()
    return (list(s[:len(s) - 1]))


def in_ints():
    return (map(int, input().split()))


ss = in_str()


def check(ss):
    i = 0
    j = len(ss)-1
    while i < j:
        if ss[i] != ss[j]:
            return False

        i+=1
        j-=1

    return True



n = len(ss)

if n%2 == 0:
    print('No')
else:
    if check(ss) and check(ss[:n//2]):
        print("Yes")
    else:
        print('No')

Submission status: Accepted

Solution code:
def RoKuKer(s):
    n = len(s)

    if n%2 != 1:
        return "No"

    s_reverse = ''
    for i in range(n-1, -1, -1):
        s_reverse += s[i]
    if s != s_reverse:
        return "No"

    l = s[:(n-1)/2]; l_recerse = ''
    r = s[(n+1)/2:]; r_reverse = ''

    for i in range(len(l)-1, -1, -1):
        l_recerse += l[i]
    for i in range(len(r)-1, -1, -1):
        r_reverse += r[i]
    
    if l != l_recerse or r != r_reverse:
        return "No"
    
    return "Yes"




if __name__ == '__main__':
    S = str(raw_input())
    print RoKuKer(S)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    S = input()[:-1]

    n = len(S)
    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]:
        print("Yes")
    else:
        print("No")
    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

kaibun = 0
for i in range(n // 2):
    if s[i] == s[n - 1 - i]:
        kaibun += 1
    else:
        break

half_bun = 0
for i in range(n // 4):
    if s[i] == s[n // 2  - 1 - i] and s[(n + 3) // 2 - 1 + i] == s[n - 1 - i]:
        half_bun += 1
    else:
        break

if kaibun == n // 2 and half_bun == n // 4:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li=list(input())
li_rev=list(reversed(li))
n=len(li)
li_slice=li[0:int((n-1)/2)]
li_slrev=list(reversed(li_slice))
n=len(li)
if li==li_rev:
    if li_slice==li_slrev:
        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:]
print("Yes" if S==S[::-1] and a==a[::-1] and b==b[::-1] else "No")

Submission status: Accepted

Solution code:
def kaibun(w):
    n=len(w)
    if w[:n//2]==w[::-1][:n//2]:
        return True
    return False

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

Submission status: Accepted

Solution code:
s = list(input())

length = len(s)
s_before = s[:int((length-1)/2)]
check = True
for i,letter in enumerate(s):
	if s[i] != s[len(s)-i-1]:
		check = False

check_bofore = True
for i,letter in enumerate(s_before):
	if s_before[i] != s_before[len(s_before)-i-1]:
		check = False
if check and check_bofore:
  	print('Yes')
else:
  	print('No')

Submission status: Accepted

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

s = list(str(input()))
N = len(s)


def disc(s):
    s1 = s
    s2 = s[:]
    s2.reverse()
    if s1 == s2:
        return True
    else:
        return False


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

Submission status: Accepted

Solution code:
s = input()

n = len(s)
s_rev = s[::-1]

s_mae = s[:int((n-1)/2)]
s_mae_rev = s_mae[::-1]

s_usi = s[int((n+3)/2-1):]
s_usi_rev = s_usi[::-1]

if s == s_rev and s_mae == s_mae_rev and s_usi == s_usi_rev:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

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

def Check2(S):
    S2 = ""
    for i in range(0, (len(S) - 1) // 2):
        S2 = S2 + S[i]
    return Check1(S2)

def Check3(S):
    S3 = ""
    for i in range((len(S) + 3) // 2 - 1, len(S)):
        S3 = S3 + S[i]
    return Check1(S3)

if Check1(S) and Check2(S) and Check3(S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
F=S[0:(N-1)//2]
B=S[(N+3)//2-1:N]

if(F==B):
    l=len(F)
    for i in range(l//2):
        if(F[i]!=F[l-1-i]):
            print("No")
            break
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

    for i in range(0,N):
        if S[i] != S[N-1-i]:
            print('No')
            return
    
    for i in range(0,int((N-1)/2)):
        if S[i] != S[int((N-1)/2)-1-i]:
            print('No')
            return

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

    print('Yes')

main()

Submission status: Accepted

Solution code:
def Palindrome(string):
	return string == string[::-1]

def strongPalindrome(string):
	n = len(string)
	if not Palindrome(string):
		return 'No'
	if not Palindrome(string[:(n - 1) // 2]):
		return 'No'
	if not Palindrome(string[(n + 3) // 2 - 1:]):
		return 'No'
	return 'Yes'

string = input()
print(strongPalindrome(string))

Submission status: Accepted

Solution code:
S = input()
N = len(S)
f = S[:int((N-1)/2)]
l = S[int((N+1)/2):]

if f==l:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def iskaibun(s):
    lens=len(s)
    #print(s)
    for i in range(lens // 2):
        #print("{} {}".format(s[i],s[lens-1-i]))
        if s[i] != s[lens-1 - i]:
            return False
    
    return True
    
s = input()
lens=len(s)
#print(s[0: (lens - 2) // 2+1])
#print(s[(lens + 2) // 2 : lens])
if iskaibun(s) and iskaibun(s[0: (lens - 1) // 2]) and iskaibun(s[(lens + 2) // 2 : lens]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

s = list(input())
l = []
r = []

for i in range(int((len(s)-1)/2)):
    l.append(s[i])

for i in range(int((len(s)+1)/2),len(s)):
    r.append(s[i])

lr = l.copy()
lr.reverse()

rr = r.copy()
rr.reverse()

sr = s.copy()
sr.reverse()

if l == lr and r == rr and s == sr:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# B - String Palindrome
# https://atcoder.jp/contests/abc159/tasks/abc159_b

import sys

S = input()
N = len(S)

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

if not is_palindrome(S):
    print("No")
    sys.exit()

if not is_palindrome(S[:(N-1)//2]):
    print("No")
    sys.exit()

if not is_palindrome(S[(N+3)//2-1:]):
    print("No")
    sys.exit()

print("Yes")

Submission status: Accepted

Solution code:
l=list(input())
def kaibun(c):
  d=c[::-1]
  if c == d:
    return 0
  else:
    return 1
a=kaibun(l)
m=l[:int((len(l)-1)/2)]
n=l[int((len(l)+1)/2):]

b=kaibun(m)
c=kaibun(n)

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

Submission status: Accepted

Solution code:
S = input()
BUN = list(S)
N = 0
for a in BUN:
    N += 1
X = N //2
if BUN[0:X] == BUN[X+1:N+1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input();t=s[:len(s)//2];u=s[len(s)//2+1:]

def check(string):
  for i in range(len(string)):
    if string[i] != string[len(string)-i-1]:
      return False
  return True
  
print("Yes" if all([check(s),check(t),check(u)]) else "No")

Submission status: Accepted

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

zenhan = s[:int((n-1)/2)]
kouhan = s[int((n+3)/2)-1:]

def kaibun_check(str):
  l = len(str)
  ls = int(l//2)+1
  for i in range(ls-1):
    if str[i] == str[l-i-1]:
      continue
    else:
      return False
      break
  return True
    
if kaibun_check(s) and kaibun_check(zenhan) and kaibun_check(kouhan):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
cnt=0
cnt1=0
cnt2=0
for i in range (N):
    if S[i]==S[N-1-i]:
        cnt+=1

if cnt==N:
    for j in range((N-1)//2):
        if  S[j]==S[(N-1)//2 -1-j]:
            cnt1+=1
    if cnt1==(N-1)//2:
        for k in range((N-1)//2):
            if S[(N+3)//2 -1+k]==S[N-1-k]:
                cnt2+=1
    else:
        print("No")
        exit()
    if cnt2==(N-1)//2:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
def is_kaibun(s: str) -> bool:
    return s == s[::-1]


S = input()
N = len(S)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N = input()
n = len(N)

N1 = N
N2 = N[:int((n-1)/2)]
N3 = N[int(((n+3)/2)-1):]

N1r = ''.join([N1[i] for i in range(len(N1)-1, -1, -1)])
N2r = ''.join([N2[i] for i in range(len(N2)-1, -1, -1)])
N3r = ''.join([N3[i] for i in range(len(N3)-1, -1, -1)])

if N1 == N1r and N2 == N2r and N3 == N3r : 
    print('Yes')
else : 
    print('No')

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
# B

S = input()

N = len(S)

f = S[:int((N-1)/2)]
l = S[int((N+1)/2):]
#print(f,l)

if f==l:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
a = input()

a_r = ''.join(list(reversed(a)))

a1 = a[0:(len(a)//2)]
a1_r = ''.join(list(reversed(a1)))
a2 = a[len(a)//2+1:len(a)]
a2_r = ''.join(list(reversed(a2)))

if a == a_r and a1 == a1_r and a2 == a2_r:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def main():
    s = input()
    length = len(s)
    count = 0
    s2 = s[:((length-1)//2)]
    s3 = s[((length+3)//2-1):]
    if s == s[::-1]:
        count += 1

    if s2 == s2[::-1]:
        count += 1

    if s3 == s3[::-1]:
        count += 1

    return 'Yes' if count == 3 else 'No'


if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_palindrome(str):
  i, j = 0, len(str)-1
  while i <= j:
    if str[i] != str[j]:
      return False
    i += 1
    j -= 1

  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)

if list(S) == list(reversed(S)):
    if list(S[0:(N-1)//2]) == list(reversed(S[0:(N-1)//2])):
        if list(S[(N+1)//2:N]) == list(reversed(S[(N+1)//2:N])):
            print("Yes")
            exit(0)
print("No")

Submission status: Accepted

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

S1 = S[0:int((N-1)/2)]
S2 = S[int((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()
Sa = list(S)
N = len(Sa)

kaibun1 = 0
for i in range(len(Sa)):
    if Sa[i] == Sa[-(i+1)]:
        kaibun1 += 1

kaibun = 0

if kaibun1 == len(Sa):
    kaibun += 1
        
del Sa[((len(Sa)+1)//2)-1:len(Sa)]


kaibun2 = 0
for i in range(len(Sa)):
    if Sa[i] == Sa[-(i+1)]:
        kaibun2 += 1
        
if kaibun2 == len(Sa):
    kaibun += 1

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

Submission status: Accepted

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

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

S_all=is_palindrome(S)
S_forward=is_palindrome(S[:(N-1)//2])
S_rear=is_palindrome(S[(N+3)//2-1:])

if (S_all==True  and S_forward==True)  and S_rear==True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n = len(s)
k = int((n+3)/2 - 1)
flag = 0
for i in range(n-1):
    if not s[i] == s[n-1-i]:
        break
else:
    flag += 1

for i in range(int((n-1)/2)):
    if not s[i] == s[int((n-1)/2 - 1 - i)]:
        break
else:
    flag += 1

for k in range (n):
    if not s[k] == s[n-1-k]:
        break
else:
    flag += 1

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

Submission status: Accepted

Solution code:
s = input()
ans = True
def isP(s):
  return s == s[::-1]
if not isP(s):
  ans = False
if not isP(s[:len(s)//2]):
  ans = False
if ans:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
def is_kaibun(s):
    n = len(s)
    flag = True
    for i in range(n//2):
        flag = (flag and s[i] == s[n-i-1])
    return flag
        
s = input()
n = len(s)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    s = str(readline().rstrip().decode('utf-8'))
    sb = s[:len(s)//2]
    sa = s[len(s)//2 + 1:]
    for i in range(len(s)):
        if s[i] != s[-i-1]:
            print("No")
            exit()
    for i in range(len(sb)):
        if sb[i] != sb[-i-1] or sa[i] != sa[-i-1]:
            print("No")
            exit()
    print("Yes")


if __name__ == '__main__':
    solve()

Submission status: Accepted

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

def check_palindrome(s):
    s_ = s[::-1]
    return s == s_

s_list = [
    S[:],
    S[:int((N - 1) / 2)],
    S[int((N + 3) / 2) - 1:],
]
# print(s_list)

result = "Yes"
for s in s_list:
    if not check_palindrome(s):
        result = "No"
        break
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
f = []
l = []
ans = 'Yes'
for i in range(int((len(S)-1)/2)):
    f.append(S[i])
    l.append(S[-i-1])
for i in range(len(f)):
    if f[i] != l[-i-1]:
        ans = 'No'
print(ans)

Submission status: Accepted

Solution code:
S = input()
s = S[::-1]
N = len(S)
n = len(S) // 2 # middle index

if S == s:
  if S[ : n] == s[n+1: ] and s[ : n] == S[n+1 : ]:
    print("Yes")
    exit()
print("No")

Submission status: Accepted

Solution code:
S=input()
S_check=[]
S_check2 =[]

for i in range (0,len(S)):
    S_check2.append(S[i])
    
    
for i in range (0,len(S)//2):
    S_check.append(S[i])

S_check.append(S[len(S)//2])

for i in range (0,len(S)//2):
    S_check.append(S[i])
    



if S_check==S_check2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
s = input()

ss = s[::-1]
n = len(s)
s1 = s[0:int((n-1)/2)]
ss1 = s1[::-1]
s2 = s[int((n+3)/2-1):n]
ss2 = s2[::-1]

if s==ss and s1==ss1 and s2==ss2:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S) #lenはリアル個数を出力
ans = ""
for i in range(N // 2):
    if S[0 + i] == S[(N - 1) - i]:
        ans = "Yes"
    else:
        ans = "No"
        break
    if S[0 + i] == S[((N - 1) // 2) - 1 - i]:
        ans = "Yes"
    else:
        ans = "No"
        break
    if S[((N + 3) // 2) - 1 + i] == S[(N - 1) - i]:
        ans = "Yes"
    else:
        ans = "No"
        break
print(ans)

Submission status: Accepted

Solution code:
def kaibun(text):
	mid = len(text) // 2
	for i in range(mid):
		if text[i] != text[-1 * (i + 1)]:
			return False

	return True


if __name__ == '__main__':
	text = input()
	t_len = len(text)
	if kaibun(text) and kaibun(text[0:t_len // 2]):
		print('Yes')
	else:
		print('No')

Submission status: Accepted

Solution code:
S = input()

count = 0

if len(S) != 3:
    for i in range(len(S)//2):
        if S[i] == S[len(S)-i-1]:
            count += 1
else:
    if S[0] == S[2]:
        count = 1

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

Submission status: Accepted

Solution code:
s=input().strip()
n=len(s)
ans="No"

if s==s[::-1]:
  if s[:(n-1)//2]==s[(n-1)//2-1::-1] and s[(n+3)//2-1:]==s[:(n+3)//2-2:-1]:
    ans="Yes"
print(ans)

Submission status: Accepted

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

m = S[0:(N-1)//2]
h = S[((N-1)//2)+1:N]

print("Yes" if m == m[::-1] and h == h[::-1] and m == h else "No")

Submission status: Accepted

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

    def is_palin(s_):
        return s_ == "".join(list(reversed(s_)))

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_palindrome(text):
  mid = len(text) // 2
  # 奇数の場合
  if len(text) % 2 == 1:
    if text[:mid] == text[mid+1:][-1::-1]:
      return True
    else:
      return False
  # 奇数の場合
  else:
    if text[:mid] == text[mid:][-1::-1]:
      return True
    else:
      return False

s = input()

mid = len(s) // 2

front = s[:mid]       # 前半
back  = s[mid+1:]     # 後半
if is_palindrome(s) and is_palindrome(front) and is_palindrome(back):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s=input()
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:
def is_palindrome(string):
    return string == string[::-1]

string = input()

is_string_palindrome = 'No'
left_substring = string[0:len(string)//2]
right_substring = string[(len(string)//2) + 1:]
if is_palindrome(string) and is_palindrome(left_substring) and is_palindrome(right_substring):
    is_string_palindrome = 'Yes'

print(is_string_palindrome)

Submission status: Accepted

Solution code:
S=list(input())

s_1=[]
s_2=[]

for i in range(0,int(len(S)/2)):
    s_1.append(S[i])

for i in range(int(len(S)/2)+1,len(S)):
    s_2.append(S[i])


def kaibun(s):
    s=list(s)
    n=len(s)
    if n%2==0:
        for i in range(int(n/2)):
            if s[i]!=s[n-1-i]:
                return None
    else:
        for i in range(int(n/2)):
            if s[i] != s[n -1- i]:
                return None
    return True

if kaibun(S) and kaibun(s_1) and kaibun(s_2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input();t = s[:len(s)//2];u = s[len(s)//2+1:]

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

print("Yes" if all([check(s),check(t),check(u)]) else "No")

Submission status: Accepted

Solution code:
#-String Palindrome
import math
character = input()
re_character = character[::-1]
 
num = int(len(character))
middle = math.ceil(num/2.0)
#print(middle)
#print(character[0:middle-1], re_character[middle:num])
#print(character[0:num], re_character[0:num])
#print (character[middle:num], re_character[0:middle-1])

if (character[middle:num] == re_character[0:middle-1]):
  if (character[0:num] == re_character[0:num]):
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

if is_palindrome(S) \
and is_palindrome(S[:len(S)//2]):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

result = (S == ''.join(list(reversed(S))) and
S[0:int((N-1)/2)] == ''.join(list(reversed(S[0:int((N-1)/2)]))) and
S[int((N+3)/2):-1] == ''.join(list(reversed(S[int((N+3)/2):-1]))))

print('Yes') if result == True else print('No')

Submission status: Accepted

Solution code:

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

s1_ = list(reversed(s1))
s2_ = list(reversed(s2))

if(s1==s2 and list(s1)==s1_ and list(s2)==s2_):
  	print('Yes')
else:
  	print('No')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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