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)
A=S[0:(N-1)//2]
B=S[(N+3)//2-1:N]
T=S[::-1]
print("Yes" if A==B and S==T else "No")

Submission status: Accepted

Solution code:
S = input()
ch = list(S)
num = len(S)
n1 = int((num-1)/2)
result = str("Yes")
i = int(0)
j = int(0)
k = int(0)
while i < n1:
    if ch[i] == ch[n1-1-i]:
        i = i+1
    else:
        result = str("No")
        break
if result == "Yes":
    while j < n1:
        if ch[num - n1+j] == ch[num - j-1]:
            j = j+1
        else:
            result = str("No")
            break
if result == "Yes":
    while k < num:
        if ch[k] == ch[num-1-k]:
            k = k + 1
        else:
            result = str("No")
            break
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

forward = s[:(n-1)//2]
back = s[(n+3)//2 - 1:]



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

Submission status: Accepted

Solution code:
#abc159 b
s=input()
def kaibun(string):
    kj=True
    mid=len(string)//2
    for i in range(mid):
        if string[i]!=string[len(string)-1-i]:
            kj=False
            break
    return kj
x=(len(s)-1)//2
y=(len(s)+3)//2
if kaibun(s)==kaibun(s[:x])==kaibun(s[y-1:])==True:
     print("Yes")
else:
     print("No")

Submission status: Accepted

Solution code:
#B
S = input()
Slist = list(S)
ans = 'Yes'
for k in range (int(len(Slist) / 2)):
    if Slist[k] != Slist[len(Slist) - k - 1]:
        ans = 'No'
N = len(Slist)
if ans == 'Yes':
    for k in range (int(int((N)/2)/2)):
        if Slist[k] != Slist[int((N-1)/2) - k - 1]:
            ans = 'No'
if ans == 'Yes':
    for k in range (int(int((N)/2)/2)):
        if Slist[N-k-1] != Slist[int((N+3)/2) + k - 1]:
            ans ='No'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

flag=True

if list(S)!=list1:
    flag=False

list2=list(S)[:(N-1)//2]
if list2!=list2[::-1]:
    flag=False

list3=list(S)[(N+3)//2-1:]
if list3!=list3[::-1]:
    flag=False

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

Submission status: Accepted

Solution code:
def pali (s):
    if(1):
        start=0
        end=len(s)-1
        while(start<end):
            if(s[start]!=s[end]):
                return 0
            start+=1
            end-=1
        return 1
s=input()
n=len(s)
s1=s[:(n-1)//2]
s2=s[(n+3)//2-1:]
if(pali(s)==1 and (pali(s1)==1 and pali(s2)==1)):
    print ('Yes')
else:
    print ('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def checkKaibun(str):
    for i in range(int(len(str) / 2)):
        if str[i] != str[-i - 1]:
            return False
    return True
 
s = input()
n = len(s)
c2e = int((n - 1) / 2)
c3s = int((n + 3) / 2) - 1
if not checkKaibun(s):
    print('No')
elif not checkKaibun(s[0:c2e]):
    print('No')
elif not checkKaibun(s[c3s:n]):
    print('No')
else :
    print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

#initialize
IsKaibun = 'No'

N = len(S)

def check_kaibun( mojiretu ):
    names = len(mojiretu)
    IsKaibunLocal = 'Yes'
    for name in range((names + 1) // 2):
        if mojiretu[name] != mojiretu[names - 1 - name]:
            IsKaibunLocal = 'No'

    return IsKaibunLocal

#pre check
if N%2 != 1 and N < 3 and N >  99 :
    PRE_CHECK = 1

#1st check
IsKaibun = check_kaibun(S)

#2nd check
if IsKaibun == 'Yes':
    IsKaibun =  check_kaibun(S[ 0 : int((N-1)/2) ])

#3rd check
if IsKaibun == 'Yes':
    IsKaibun = check_kaibun(S[ int((N+3)/2 - 1) : N ])

#output
print(IsKaibun)

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:
word = input()

length = int((len(word) - 1) / 2)


def judge_a(kaibun):
    if kaibun == kaibun[::-1]:
        return True
    return False


def judge_b(kaibun):
    if kaibun[:length] == kaibun[length-1::-1]:
        return True
    return False


def judge_c(kaibun):
    if kaibun[length + 1:] == kaibun[:length:-1]:
        return True
    return False


if judge_a(word) == True:
    if judge_b(word) == True:
        if judge_c(word) == True:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
s=str(input())
n=len(s)
ans=0
for i in range(int((n-1)/2)):
  if s[i]!=s[n-1-i]:
    ans+=1
    #print("3",i)
nn=int((n-1)/2)
if nn//2==0:
  nna=int(nn/2)
else:
  nna=int((nn-1)/2)
for i in range(nna):
  if s[i]!=s[nn-1-i]:
    ans+=1
    #print("1",i)
nnn=int((n+3)/2)
nnnn=n-nnn+1
if nnnn//2==0:
  nnb=int(nnnn/2)
else:
  nnb=int((nnnn-1)/2)
for i in range(nnnn):
  if s[nnn-1+i]!=s[n-1-i]:
    ans+=1
    #print(nnn-1-i,n-1-i)
if ans==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

count = 0
S_bak = list(reversed(S))
# print(S)
# print(S_bak)
if S == S_bak:
    count += 1
    # print("1")

one = S[0:a]
# print(a)
# print(one)
one_bak = list(reversed(one))
if one == one_bak:
    count += 1
    # print("2")

two = S[b-1:N]
# print(b)
# print(two)
two_bak = list(reversed(two))
# print(two_bak)
if two == two_bak:
    count += 1
    # print("3")

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

Submission status: Accepted

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

s1=s[:s_l//2]
s2=s[s_l//2+1:]

c=1

for i in range(len(s)-1):
  if s[i]!=s[-1-i]:
    c=0

for i in range(len(s1)-1):
  if s1[i]!=s1[-1-i]:
    c=0
for i in range(len(s2)-1):
  if s2[i]!=s2[-1-i]:
    c=0

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

Submission status: Accepted

Solution code:
def String_palind(s):

    ans = "No"
    scount = int((len(s) - 1) / 2)
    ecount = int((len(s) + 3) / 2)
    slen = s[:scount]
    elen = s[ecount - 1:]

    if s == s[::-1] and slen == slen[::-1] and elen == elen[::-1]:
        ans = "Yes"

    return ans

def main():
    s = str(input())
    print(String_palind(s))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
n=len(s)
str=s
str=str[::-1]
if(s!=str):
    print('No')
else:
    temp=(n-1)//2
    st=""
    for i in range(temp):
        st+=s[i]
    str1=st
    str1=str1[::-1]
    if(st!=str1):
        print('No')
    else:
        temp=(n+3)//2
        temp=temp-1
        st1=""
        for i in range(temp,n):
            st1+=s[i]
        str2=st1
        str2=str2[::-1]
        if(st1!=str2):
            print('No')
        else:
            print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#author : dokueki

import sys


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


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


if __name__ == "__main__":
    #IOE()
    main()

Submission status: Accepted

Solution code:
import math
s=list(input())
half_s=int((len(s)-1)/2)
def kaibun_hantei(p):
  half_l=math.ceil((len(p)-1)/2)
  if len(p)%2==1:
    if p[:half_l]==p[(half_l+1):][::-1]:
      return 100
  else:
    if p[:half_l]==p[(half_l):][::-1]:
      return 100

if kaibun_hantei(s)==100:
  if kaibun_hantei(s[:half_s])==100:
    print('Yes')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

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

def solve(s):
  return check(s) and check(s[:int((len(s)-1)/2)]) and check(s[int((len(s)+3)/2-1):])

S = input()

if solve(S):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

    return 1

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

if kaibun(s) == 1 and kaibun(left) == 1 and kaibun(right) == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
left = s[0:int((n-1)/2)]
right = s[int((n+3)/2)-1:n]
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)
def pal(x):
    for i in range(len(x)//2):
        if x[i]!=x[-1-i]:
            return False
    return True
if pal(s[:n//2]) and pal(s[n//2+1:]) and pal(s):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def is_pal(s):
    if len(s) < 2:
        return True
    elif s[0] == s[-1]:
        return is_pal(s[1:-1])
    return False

s = input().strip()
ja = len(s)
#print(s,(ja-1)/2,(ja+3)/2)
s1 = s[:int((ja-1)/2)]
s2 = s[int((ja+3)/2)-1:]
#print(is_pal(s), is_pal(s1), is_pal(s2))
print("Yes" if (is_pal(s) and is_pal(s1) and is_pal(s2)) else "No")

Submission status: Accepted

Solution code:
s=str(input())
def isPalin(l,r):
  if l >= r:
    return True
  if s[l]!=s[r]:
    return False
  return isPalin(l+1,r-1)
n = len(s)
if isPalin(0,n-1) and isPalin(0,n//2-1) and isPalin(n//2+1,n-1):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def is_palindrome(s):
    l = len(s)
    return s[:l // 2] == s[l // 2 + l % 2:][::-1]


S = input()
L = len(S)

if is_palindrome(S) and is_palindrome(S[:L // 2]) and is_palindrome(S[L // 2 + 1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

if s[0:math.floor(n/2)] != s[math.ceil(n/2):]:
  print('No')
  sys.exit()

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

print('Yes')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def Palindrome(S):
    if len(S)==1:
        return "Yes"
    for i in range(int((len(S))/2)):
        if S[i]==S[len(S)-i-1]:
            YorN="Yes"
        else:
            YorN="No"
            break
    return YorN
S = input()
Sl = list(S)
left = right = "No"
if Palindrome(Sl) == "Yes":
    middle=int((len(Sl)-1)/2)
#    print(Sl[:middle],Sl[middle+1:])
    left  = Palindrome(Sl[:middle])
    right = Palindrome(Sl[middle+1:])
if left == "Yes" and right == "Yes":
    YorN = "Yes"
else:
    YorN = "No"
print(YorN)

Submission status: Accepted

Solution code:
s = input()
n = len(s)
left = s[0:int((n-1)/2)]
right = s[int((n+3)/2)-1:n]
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)



a = S[0:(N-1)//2]
b = a[::-1]

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

e = S
f = S[::-1]

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

Submission status: Accepted

Solution code:
s = input()

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

flag = True

if s != s[::-1]:
    flag = False
if s1 != s1[::-1]:
    flag = False

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

Submission status: Accepted

Solution code:
S=input()
def ispalindrome(str): return 1 if str == str[::-1] else 0
L=(len(S)-1)//2
T=S[:L]
U=S[L+1:]
if ispalindrome(S)==1 and ispalindrome(T)==1 and ispalindrome(U)==1:
    print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
def check(s):
    n = len(s)
    if s != s[::-1]:
        return False
    t = s[:(n - 1) // 2]
    if t != t[::-1]:
        return False
    u = s[(n + 3) // 2 - 1:]
    if u != u[::-1]:
        return False
    return True


s = input()
print('Yes' if check(s) else 'No')

Submission status: Accepted

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

flag = True
# [:] の指定は　左が閉区間、右が開区間 [ )こんな感じ
if s != s[::-1]:
    flag = False
if s1 != s1[::-1]:
    flag = False
if s2 != s2[::-1]:
    flag = False
print("Yes") if flag else print("No")

Submission status: Accepted

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

def is_parin(s):
    return all((s[i]==s[len(s)-1-i] for i in range(len(s)//2)))

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

Submission status: Accepted

Solution code:
S = input()

N = len(S)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = input()
N = len(X)//2

if X==X[::-1] and X[:N]==X[-N:] :
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

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

def is_strong_palindrome(s):
  return is_palindrome(s) \
    and is_palindrome(s[:(len(s) - 1) // 2]) \
    and is_palindrome(s[(len(s) + 3) // 2 - 1:])

if is_strong_palindrome(S):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()


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


if (
    check_kaibun(s)
    and check_kaibun(s[: (len(s) - 1) // 2])
    and check_kaibun(s[(len(s) + 2) // 2 :])
):
    print("Yes")
else:
    print("No")

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()
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:
s = input()
d = len(s)//2
print('Yes' if s[:d] == s[d+1:] else 'No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()
c= len(s) // 2

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

Submission status: Accepted

Solution code:
s = input()
flg = 0
n = len(s)
s1 = s[0:(n-1)//2]
s2 = s[(n+3)//2-1:]
t1 = s1[::-1]
t2 = s2[::-1]
#print(s1,s2,t1,t2)

for i in range(len(s1)):
  if s1[i] != t1[i] or s2[i] != t2[i]:
    flg = 1
    break
for i in range(n//2):
  if s[i] != s[-(i+1)]:
    flg = 1
    break
 
print("Yes" if flg == 0 else "No")

Submission status: Accepted

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

if s == "".join(list(reversed(s))) and s1 == "".join(list(reversed(s1))) and s2 == "".join(list(reversed(s2))):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

S = input()
mid = (len(S)-1)//2

if check(S[:mid]) and S[:mid] == S[mid+1:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


if S == list(reversed(S)):
  a = []
  b = []
  for i in range(int((N - 1) / 2)):
    a.append(S[i])
  for i in range(int((N + 3) / 2 - 1), N):
    b.append(S[i])

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
S_r=S[:(N-1)//2]
S_l=S[(N-1)//2+1:]


for i in range(N):
  if S[i]!=S[-i-1]:
    print("No");exit()
for i in range(N//2):
  if S_l[i]!=S_l[-i-1]:
    print("No");exit()
  if S_r[i]!=S_r[-i-1]:
    print("No");exit()
print("Yes")

Submission status: Accepted

Solution code:
def fin():
    print('No')
    quit()

input_line = input()
if not input_line == input_line[::-1]:
    fin()

N = len(input_line)
new_str = input_line[0:(N-1)//2]
if not new_str == new_str[::-1]:
    fin()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ispalindrome(s, b, e):
    i = b; j = e
    while i < j :
        if s[i] != s[j] :
            return False
        i += 1
        j -= 1
    return True
    
    
s = input()
n = len(s)
if ispalindrome(s,0,(n-3)//2) and ispalindrome(s,0,n-1) :
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

q=input()
y=len(q)


u=((y-1)//2);
p=((y+3)//2)-1;

t=q[0:u]
r="".join(reversed(t))

i=q[p:]
o="".join(reversed(i))

a="".join(reversed(q))
if a==q and o==i and t==r:
       print("Yes")
else :
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

sl = s[:length//2]
sr = s[length//2 + 1:]
if sl == sr and sr == sr[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()
N=len(S)
S1=S[:int((N-1)/2)]
S2=S[int((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:
s = input()
ps1 = s[:len(s)//2]
ps2 = s[(len(s)+2)//2:]

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()
n = list(s)
l = len(s)
check = 0

if l%2 == 1:
    for i in range(0,l-1):
        if n[i] != n[l-(i+1)]:
            check =1
            break
    for i in range(0,int((l-1)/2)-1):
        if n[i] != n[int(((l-1)/2)-(i+1))]:
            check =1
            break
    for i in range(0,int((l-1)/2)-1):
        if n[int((l-1)/2)+1+i] != n[(l-1-i)]:
            check=1
            break
    if check ==0:
        print('Yes')
    else:
        print('No')
else:
    print ('No')

Submission status: Accepted

Solution code:
"""
Author: guiferviz
Time: 2020-03-27 15:55:42
"""


def check_palin(s):
    i = 0
    j = len(s) - 1
    while i<j:
        if s[i] != s[j]:
            return False
        i += 1
        j -= 1
    return True

def main():
    s = input()
    n = len(s)
    middle = (n - 1) // 2
    res = check_palin(s) and check_palin(s[:middle]) and check_palin(s[middle+1:])
    print("Yes" if res else "No")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

str = input()
is_palindrome = palindrome(str)
n = len(str)
if is_palindrome and n % 2 == 1:
  is_palindrome = palindrome(str[:(n - 1)// 2]) and palindrome(str[(n + 1) // 2:])

print("Yes" if is_palindrome else "No")

Submission status: Accepted

Solution code:
from fractions import gcd
import sys
#input = sys.stdin.readline()
sys.setrecursionlimit(4100000)

def ols(): return input()
def oli(): return map(int, input().split())
def olai(): return list(map(int, input().split()))
def olas(): return list(input().split())
def mlai(L): return [int(input()) for _ in range(L)]
def mlas(L): return [input() for _ in range(L)]

def palindrome(S):
    return S == S[::-1]

s = ols()

if palindrome(s) and palindrome(s[:-len(s)//2]) and palindrome(s[len(s)//2+1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_palindrome(s):
    return all(c1 == c2 for c1, c2 in zip(s, reversed(s)))


S = input()
N = len(S)

if all(is_palindrome(s) for s in (S, S[: (N - 1) // 2], S[(N + 3) // 2 - 1 :])):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

front = S[0:int((n-1)/2)]
back = S[int((n+1)/2):]

#print(front)
#print(back)

if front == back:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def isPalindrome(s): 
    rev = ''.join(reversed(s)) 
    if (s == rev): 
        return True
    return False
s=input()
n=len(s)
if n%2==1:
    if isPalindrome(s):
        k=n//2
        s1=s[:k]
        if isPalindrome(s1):
            v=(n+3)//2-1 
            s2=s[v:]
            if isPalindrome(s2):
                print("Yes")
            else:
                print("No")    
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

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

from sys import stdin, stdout

s = str(input())
length = len(s)
s1, s2, s3 = 0, 0, 0

def palindrome(start, end):

    for i, j in zip(range(start, end), range(end-1, 0, -1)):
        if (j == i):
            return 1
        if (s[i] != s[j]):
            print ("No")
            exit()

s1 = palindrome(0, length)
s2 = palindrome(0, int(((length-1)/2)))
s3 = palindrome(int(((length+3)/2))-1, length)

print ("Yes")

Submission status: Accepted

Solution code:
def P(s):
  return s==s[::-1]
 
S=list(input())
N=len(S)
print('Yes' if P(S) and P(S[:N//2]) and P(S[N//2+1:]) else 'No')

Submission status: Accepted

Solution code:
s = input()
ans = True
def isP(l):
  return l == l[::-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:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
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():
    s = S()
    n = len(s)
    s1 = s[:(n-1)//2]
    s2 = s[((n+3)//2)-1:][::-1]
    if len(s1) % 2 == 0:
        s11 = s1[:len(s1)//2]
    else:
        s11 = s1[:(len(s1)-1)//2]
    s12 = s1[((len(s1)+3)//2)-1:][::-1]
    if s1 == s2 and s11 == s12:
        print('Yes')
    else:
        print('No')
    return


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

Submission status: Accepted

Solution code:
s=input()
S=[a for a in s]
N=len(S)
number=0
for a in range(N//2):
    if S[a]==S[N-a-1]:
        number+=1
if number!=N//2:
    print('No')
else:
    n=N//2
    answer=0
    for b in range(n//2):
        if S[b]==S[n-1-b]:
            answer+=1
    if answer!=n//2:
        print('No')
    else:
        moji=S[n+1:]
        suuji=0
        for a in range(n//2):
            if moji[a]==moji[n-a-1]:
                suuji+=1
        if suuji==n//2:
            print('Yes')
        else:
            print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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


s = input()
print('Yes' if solve(s) else 'No')

Submission status: Accepted

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

Submission status: Accepted

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

c = int(n/2)

for i in range(c):
    if s[i] != s[-i-1]:
        print('No')
        exit()

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

for i in range(c+1, c+1+int(c/2)):
    if s[i] != s[-i-1]:
        print('No')
        exit()

print('Yes')

Submission status: Accepted

Solution code:
s=input()
wlist=[]
for ch in s:
  wlist.append(ch)
N=len(wlist)
F=int((N-1)/2)
A=int((N+3)/2)
r=0
for i in range(F-1):
  if wlist[i]!=wlist[N-1-i]:
    r=r+1
  if wlist[i]!=wlist[F-1-i]:
    r=r+1
  if wlist[A-1+i]!=wlist[N-1-i]:
    r=r+1
if r==0:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()
b = True

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
h=n//2

ans = "Yes"
for i in range(h):
  if s[i] != s[-i-1]:
    ans = "No"

p1 = s[0:h]
for i in range(len(p1)//2):
  if p1[i] != p1[-i-1]:
    ans = "No"

p = int((n+3)/2)-1
p2 = s[p:]
for i in range(len(p2)//2):
  if p2[i] != p2[-i-1]:
    ans = "No"
    
print(ans)

Submission status: Accepted

Solution code:
def judge(s):
    inv_str = s[::-1]
    # print(inv_str)
    if(s == inv_str):
        return 0
    else:
        return 1

x = str(input())
len = len(x)
x1 = x[:int((len-1)/2)]
x2 = x[int((len+3)/2-1):]

if(judge(x1)==0 and judge(x2)==0 and judge(x)==0):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

def cal(h, s):
    for i in range(h):
        j = (i*-1)-1

        if s[i] != s[j]:
            print('No')
            exit()


cal(h, s)
cal(len(s1), s1)
cal(len(s2), s2)


print('Yes')

Submission status: Accepted

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

flag = True
for i in range(len(S)//2):
    if S[i] != S[-i-1]:
        flag = False
        
left = S[0:(N-1)//2]
for i in range(len(left)//2):
    if left[i] != left[-i-1]:
        flag = False
        
right = S[(N+2)//2:N]
for i in range(len(left)//2):
    if right[i] != right[-i-1]:
        flag = False
        
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
flag = True

for i in range(len(S) // 2):
    if S[i] != S[len(S) - 1 - i]:
        flag = False

for i in range((len(S) - 1) // 2 //2):
    if S[i] != S[(len(S) - 1) // 2 -1 - i]:
        flag = False

for i in range((len(S) - (len(S) + 3 // 2)) // 2):
    if S[(len(S) + 3) // 2 -1 + i] != S[len(S) - 1 - i]:
        flag = False
        
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

N = len(S)

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

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

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

print(ans)

Submission status: Accepted

Solution code:
S = str(input())
N = len(S)
L = []
for i in range(int((N-1)/2)):
    if S[i] == S[int((N-3)/2)-i] and S[int((N+1)/2)+i] == S[N-i-1]:
        L.append('Yes')
    else:
        L.append('No')
for i in range(N):
    if S[i] == S[N-1-i]:
        L.append('Yes')
    else:
        L.append('No')
if all(x=='Yes' for x in L):
    print('Yes')
else:
    print('No')