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:
def isOK(x):
    return x == "".join(reversed(x))


def calculate(S):
    if isOK(S) == False:
        print("No")
        return

    arr = list(S)
    length = len(arr)

    s1 = arr[0:(length-1)//2]

    if isOK("".join(s1)) == False:
        print("No")
        return

    s2 = arr[(length+2)//2:length]

    if isOK("".join(s2)) == False:
        print("No")
        return

    print("Yes")




S = input()

calculate(S)

Submission status: Accepted

Solution code:
import math
def isPalindrome(string):
    # print("str: {}".format(string))
    flg = True
    rev = string[::-1]
    return (rev == string)

S = input()

res1 = isPalindrome(S)
a = math.floor((len(S)-1)/2)
res2 = isPalindrome(S[:a])
a = math.floor((len(S)+3)/2)
res3 = isPalindrome(S[a-1:])
if (res1 and res2 and res3):
    print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
S = input()

N = len(S)

kai = True

for i in range(len(S) // 2):
    # print(S[i], S[len(S) - i - 1])
    if S[i] != S[len(S) - i - 1]:
        kai = False

for i in range((N - 1) // 2 // 2):
    # print(S[i], S[(N - 1) // 2 - i - 1])
    if S[i] != S[(N - 1) // 2 - i - 1]:
        kai = False

for i in range((N + 3) // 2 // 2):
    # print(S[i + (N + 3) // 2 - 1], S[N - i - 1])
    if S[i + (N + 3) // 2 - 1] != S[N - i - 1]:
        kai = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
s2 = s[:(n-1)//2]
s3 = s[(n+3)//2-1:]
flug = True
for i in range(len(s)//2):
    end = -i - 1
    if s[i] != s[end]:
        flug = False
        break
for i in range(len(s2)//2):
    end = -i - 1
    if s2[i] != s2[end]:
        flug = False
        break
for i in range(len(s3)//2):
    end = -i - 1
    if s3[i] != s3[end]:
        flug = False
        break
if flug: print("Yes")
else: print("No")

Submission status: Accepted

Solution code:
def is_palindrome(s):
    #print(s)
    s1=s[::-1]
    return s == s1

s=list(input())

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

print(r)

Submission status: Accepted

Solution code:
s=input()
left=s[:len(s)//2]
right=s[len(s)//2+1:]

if left == right:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

N1 = int((N-1)/2)

if N1%2 ==1:
    N2 = int((N1-1)/2)
else:
    N2 = int(N1/2)

result = "Yes"

for i in range(N2):
    if S[i] != S[N1-1-i]:
        result = "No"
        break

if result == "Yes":
    for i in range(N1):
        if S[i] != S[N-1-i]:
            result ="No"
            break
        

print(result)

Submission status: Accepted

Solution code:
S = input()


def main():
    l = len(S)
    for i in range(int((l - 1) / 2)):
        # print(S[i], S[l - i - 1])
        if S[i] != S[l - i - 1]:
            return False
    S2 = S[:int((l - 1) / 2)]
    # print(S2)
    for i in range(int((len(S2) - 1) / 2) + 1):
        # print(S2[i], S2[len(S2) - i - 1], len(S2), len(S2) - i - 1)
        if S2[i] != S2[len(S2) - i - 1]:
            return False
    S3 = S[int((l + 3) / 2) - 1:]
    # print(S3)
    for i in range(int((len(S3) - 1) / 2) + 1):
        # print(S3[i], S3[len(S3) - i - 1])
        if S3[i] != S3[len(S3) - i - 1]:
            return False
    return True


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    s = input()
    ans = 1
    if s != s[::-1]:
        print("No")
        return 0

    n = len(s)
    t_s = s[:(n-1)//2]
    if t_s != t_s[::-1]:
        print("No")
        return 0
    x_s = s[(n+3)//2-1:n]

    if x_s != x_s[::-1]:
        print("No")
        return 0

    print("Yes")
    return 0


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
S2 = S[:(len(S) - 1) // 2]
S3 = S[(len(S) + 3) // 2 -1:]
is_ng = False
for i in range(len(S)):
    if S[i] != S[-i - 1]:
        is_ng = True
for i in range(len(S2)):
    if S2[i] != S2[-i - 1]:
        is_ng = True
for i in range(len(S3)):
    if S3[i] != S3[-i - 1]:
        is_ng = True
print('YNeos'[is_ng::2])

Submission status: Accepted

Solution code:
def kaibun(s, start, goal):
    s_hani = s[start:goal]
    # print(str(reversed(s_hani)))
    if s_hani == ''.join(list(reversed(s_hani))):
        return True
    else:
        return False

if __name__ == '__main__':
    s = input()
    n = len(s)

    # kaibun(s, 0, n)
    # print(n)
    if kaibun(s, 0, n) and kaibun(s, 0, (n - 1) // 2) and kaibun(s, ((n + 3) // 2) - 1, n):
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
def isStrong(S):
    N = len(S)
    if S == S[::-1]:
        left = S[:(N-1)//2]
        right = S[(N+3)//2-1:]
        if left == left[::-1] and right == right[::-1]:
            return True
        else:
            return False
    else:
        return False
        
S = input()
print("Yes") if isStrong(S) else print("No")

Submission status: Accepted

Solution code:
s=list(map(str, input()))
s_=s.copy()
s.reverse()
a=s_[:int((len(s_)-1)/2)]
a_=a.copy()
a.reverse()
b=s_[int((len(s_)+3)/2)-1:]
b_=b.copy()
b.reverse()
if s_==s and a_==a and b_==b:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()
N=len(S)
flag=0
for i in range(N):
  if S[i]!=S[N-1-i]:
    flag=1
    break
    
if flag==0:
  for i in range((N-1)//2):
    if S[i]!=S[(N-1)//2-1-i]:
      flag=1
      break
    
if flag==0:
  for i in range((N+1)//2,N):
    if S[i]!=S[N-1-i]:
      flag=1
      break

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

Submission status: Accepted

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

A = S[:int((N-1)/2)]
B = S[int((N+3)/2)-1:]
# print(S,A,B)
# def palindrome(string): return 
#     string.find(string[::-1])
def palindrome(string): return 1 if string==string[::-1] else 0

# print(palindrome(S),palindrome(A),palindrome(B))
if palindrome(S) and palindrome(A) and palindrome(B):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = str(input())
t = s[::-1]
if(s != t):
    print("No")
    exit()
c = ""
for i in range((len(s)-1)//2):
    c += s[i]
e = c[::-1]
if(e != c):
    print("No")
    exit()
r = ""
for i in range(((len(s)+3)//2)-1,len(s),1):
    r += s[i]
y = r[::-1]
if(r != y):
    print("No")
    exit()
print("Yes")
"""
print(s,t)
print(e,c)
print(r,y)
"""

Submission status: Accepted

Solution code:

def iskaibun(S: str):
    # print(S)
    return all(x==y for x, y in zip(S, reversed(S)))


def main():
    S = input()
    N = len(S)
    if iskaibun(S) and iskaibun(S[:(N-1)//2]) and iskaibun(S[(N+3)//2-1:]):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = list(input())
L = len(S)
B = int((L-1)/2)
C = int((L+3)/2)

flg = 0
for i in range(L):
    if i < B:
        if S[i] != S[B - 1 - i]:
            flg = 1
        if S[L - 1 - i] != S[C - 1 + i]:
            flg = 1

    if S[i] != S[L - 1 -i]:
        flg = 1

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

Submission status: Accepted

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

for i in range(N):
    if S[i] != S[N-i-1]:
        f = False
        break

N2 = (N-1)//2
for i in range(N2):
    if S[i] != S[N2-i-1]:
        f = False
        break

N3 = (N+3)//2
for i in range(N3,N):
    if S[i] != S[N-i-1]:
        f = False
        break
if f:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def k(S):
    N = len(S)
    n = N // 2
    #print(n, N)
    for i in range(n):
        #print(S[i], S[N-1-i])
        if S[i] != S[N-1-i]:
            return False
    return True

def main():
    S = input()
    N = len(S)
    n = N // 2

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


    return 0


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
n=len(s)
p=n//2
q=(n+1)//2
kk=s[q:]

if s[0:p]==s[:p:-1] and kk==kk[::-1] :
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def check(string):
    reversed_string = list(reversed(string))
    if list(string) == reversed_string:
        return True
    else:
        return False

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

    part1 = S[:int((N-1)/2)]
    part2 = S[int((N+3)/2)-1:]

    if check(S) and check(part1) and check(part2):
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
N = len(S)
p_S = S[:int((N - 1) / 2)]
n_S = S[int((N + 3) / 2) - 1:]

def kaibun(S):
    N = len(S)
    if N % 2 == 0:
        flag = True
        for i in range(int(N / 2)):
            if S[i] != S[N - i - 1]:
                flag = False
                break
        if flag:
            return True
        else:
            return False
    else:
        flag = True
        for i in range((N // 2) + 1):
            if S[i] != S[N - i - 1]:
                flag = False
                break
        if flag:
            return True
            
if kaibun(S) and kaibun(p_S) and kaibun(n_S):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# class Solution:
#     def solve(self, a, b, c, s):
#         return str(a + b + c) + " " + s


def main():
    inp = lambda: [int(x) for x in input().split()]
    s = input()
    n = (len(s)) // 2
    is_paliny = lambda a: a == a[::-1]
    ans = "Yes" if is_paliny(s) and is_paliny(s[:n]) else "No"
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def k(string): return True if string==string[::-1] else False
s = input()
n = len(s)
if k(s) and k(s[:int((n-1)/2)]) and k(s[int((n+3)/2)-1:]):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

t = s[::-1]
a = s[0:(n-1)//2]
b = a[::-1]
c = s[(n+3)//2-1:n]
d = c[::-1]

if s == t and a == b and c == d:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
S = input().strip()

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

if not check(S):
  print('No')
  exit()
if not check(S[:(len(S)-1)//2]):
  print('No')
  exit()
if not check(S[(len(S)+3)//2-1:]):
  print('No')
  exit()
print('Yes')

Submission status: Accepted

Solution code:
S = input()

N = len(S)

ng = False
for i in range(N):#First
  if S[i] != S[-i-1]:
    ng = True
    
for i in range(N//2):#Second
  if S[i] != S[ N // 2 - i - 1]:
    ng = True

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

Submission status: Accepted

Solution code:
def kaibun(s):
  ans = True
  for i in range(int(len(s) /2)):
    if s[i] != s[-1 * i - 1]:
      ans = False
      break
  return(ans)


inp = input()
N = len(inp)
a = int((N - 1) / 2)
b = int((N + 3) / 2 -1)
inp_a = inp[:a]
inp_b = inp[b:]
if kaibun(inp) and kaibun(inp_a) and kaibun(inp_b):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def is_reverse(x):
    if x == "".join(reversed(x)):
        return True
    return False


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

Submission status: Accepted

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

Submission status: Accepted

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

rev_s = s[::-1]
fs = s[0:(n-1)//2]
rev_fs = fs[::-1]
ls = s[(n+3)//2-1:n]
rev_ls = ls[::-1]

if s == rev_s and fs == rev_fs and ls == rev_ls:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
f = 0
for i in range((N-1)//2):
  if S[i] != S[-i-1]:
    f = 1
S_2 = S[:(N-1)//2]
N_2 = len(S_2)
for i in range(N_2//2):
  if S_2[i] != S_2[-i-1]:
    f = 1
if f == 1:
  print("No")
else:
  print("Yes")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

n = len(s)
s_inv = [s[n-1-i] for i in range(n)]
s_inv = "".join(s_inv)

pre = s[:int((n-1)/2)]
pst = s[int((n+3)/2)-1:]

pre_inv = [pre[len(pre)-1-i] for i in range(len(pre))]
pre_inv = "".join(pre_inv)

pst_inv = [pst[len(pst)-1-i] for i in range(len(pst))]
pst_inv = "".join(pst_inv)

if (s == s_inv) * (pre == pre_inv) * (pst == pst_inv) == 1:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Jan 19 20:52:57 2020

@author: over-
"""

S=input()
N=len(S)

ans="Yes"

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

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

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

print(ans)

Submission status: Accepted

Solution code:
s = input()


def is_even(n):
    return 0 == n % 2


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


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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
def chk(s):
  n=len(s)
  for i in range(n//2):
    if s[i]!=s[n-1-i]:
      return False
  return True
if chk(S) and chk(S[:((N-1)//2)]) and chk(S[(N+3)//2-1:]):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()
N = len(S)
flg=0
if S == S[::-1]:
    if S[:(N - 1)//2] == S[(N -3)//2::-1]:
        flg=1
if flg == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import copy
s=input()

if s[:len(s)//2]==s[1+len(s)//2:]:
    fi=list(s[:len(s)//2])
    fis = copy.copy(fi)
    fis.reverse()
    se=list(s[1+len(s)//2:])
    ses = copy.copy(se)
    ses.reverse()
    if fi==fis and se==ses:
            print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
a = input()

N = len(a)
t = int((N-1)/2) #真ん中まで
hantei = True

for i in range(t):
  if a[i] == a[t-1-i]:
    hantei = True
  else:
    hantei = False

if hantei == False:
  print("No")
else:
  b = a[:t+1] + a[:t]
  if a == b:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

Solution code:
import sys
from math import sqrt
from collections import Counter

input = sys.stdin.readline


def I():
    return int(input())


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


def LI():
    return list(MI())


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    s = input().rstrip()

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
K = (N-1)//2
L = (N+3)//2
P = S[0:K]
Q = S[L-1:N]
if P == Q:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = list(input())
S_re = S[::-1]
#print(S_re)
ans = "Yes"
for i in range(len(S)):
    if S[i]!=S_re[i]:
        ans = "No"
        break
S_re1 = S[0:(len(S)-1)//2][::-1]
S_re2 = S[len(S)//2+1:len(S)][::-1]
#print(S_re1, S_re2)
for i in range(len(S_re1)):
    if S[i]!=S_re1[i]:
        ans = "No"
        break
for i in range(len(S)//2+1, len(S_re2)):
    if S[i]!=S_re2[i]:
        ans = "No"
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


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


def main():
    s = input()
    i = len(s)

    check_1 = s[:int((i - 1) / 2)]
    check_2 = s[int(((i - 1) / 2) + 1):]
    if is_kaibun(s) and is_kaibun(check_1) and is_kaibun(check_2):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
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')

Submission status: Accepted

Solution code:
def ispari(s):
  a = 0
  b = len(s) - 1
  while a < b:
    if not s[a] == s[b]:
      return False
    a += 1
    b -= 1
  return True

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

Submission status: Accepted

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

sa = s[:(n-1)//2]
sb = s[((n+3)//2)-1:]

if s == s[::-1] and sa == sa[::-1] and sb == sb[::-1]:
    ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
from math import ceil

S = input()
N = len(S)
b = S[:ceil((N - 1) / 2)]
c = S[ceil((N + 3)/2)-1:]


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

Submission status: Accepted

Solution code:
def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))
def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)]

s = inp()

n = len(s)

a = s[:((n-1)//2)]
b = s[((n+3)//2)-1:]

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

for j in range((len(a))//2):
    if a[j] != a[len(a)-1-j]:
        print("No")
        exit()

for k in range((len(b))//2):
    if b[k] != b[len(b)-1-k]:
        print("No")
        exit()

print("Yes")

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
a=(n-1)//2
b=(n+3)//2
ans=0
ss=[]
for i in range(a):
    ss.append(s[i])
if a%2==0:
    aa=a//2
    for i in range(aa):
        if ss[i]!=ss[-(i+1)]:
            ans=1
            break
else:
    aa=(a-1)//2
    for i in range(aa):
        if ss[i]!=ss[-(i+1)]:
            ans=1
            break
if ans==0:
    al=n-(b-1)
    if al%2==0:
        bb=al//2
        for i in range(b-1,n):
            if s[i]!=s[-(i+1)]:
                ans=1
                break
    else:
        bb=(al-1)//2
        for i in range(b-1,n):
            if s[i]!=s[-(i+1)]:
                ans=1
                break
print("Yes" if ans==0 else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ispal(a):
    z=[]
    for i in range(len(a)-1,-1,-1):
        z.append(a[i])
    if z==a:
        return True
    else: return False
s=[i for i in input()]
n=len(s)
if ispal(s):
    if ispal(s[:(n-1)//2]):
        if ispal(s[(n+3)//2-1:]):
            print('Yes')
            exit(0)
print('No')

Submission status: Accepted

Solution code:
def check_palindrome(check_string):
  return check_string == check_string[::-1]
instring = input()
N = len(instring)
first_half = instring[:(N-1)//2]
second_half = instring[(N+3)//2-1:]
if check_palindrome(instring) and check_palindrome(first_half) and check_palindrome(second_half):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
s_r = s[::-1]
s_h = s[:(n-1)//2]
s_h_r = s_h[::-1]
s_3 = s[(n+3)//2-1:]
s_3_r = s_3[::-1]

if s==s_r and s_h == s_h_r and s_3 and s_3_r:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

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

a = str[0 : (n - 1) // 2]
b = str[(n + 3) // 2 - 1: n]
if check(str) == False or check(a) == False or check(b) == False: print("No")
else: print("Yes")

Submission status: Accepted

Solution code:
S = input()

N = len(S)

def is_kaibun(x):
    list_x = list(x)
    reversed_list_x = list(reversed(list(x)))
    res = True if list_x==reversed_list_x else False
    return res

ans = 'No'

if is_kaibun(S):
    tmp = int((N-1)/2)
    if is_kaibun(S[:tmp]):
        tmp = int((N+3)/2)-1
        if is_kaibun(S[tmp:]):
            ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
'''
.append(要素) リストに要素を追加
.extend(リスト) リストを連結する
.insert(場所,要素) 指定した場所に要素追加
del 配列名[場所]
-1で末尾で末尾から一つ前

sort()
sorted(reverse=true)

配列の初期化
配列名=[a]*n+[b]*m

Decimal()
'''

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
from functools import reduce
from operator import mul
from collections import Counter


def ispalindrome(str): return 1 if str == str[::-1] else 0


n = stdin.readline().rstrip()
pos1 = int((len(n) - 1) / 2)
pos2 = int((len(n) + 3) / 2-1)
pos3 = (len(n))

a = ispalindrome(n)
b = ispalindrome(n[0:pos1])
c = ispalindrome(n[pos2:pos3])

if a & b & c:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
s1, s2 = s[:(n-1)//2], 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()
n = len(s)
s1 = s[:n//2] 
s2 = s[n//2 + 1:]

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

Submission status: Accepted

Solution code:
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    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')
resolve()

Submission status: Accepted

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

if S != S[::-1]:
    result = False

S2 = S[0:int((N-1)/2)]
if S2 != S2[::-1]:
    result = False

S3 = S[int((N+1)/2):]
if S3 != S3[::-1]:
    result = False

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

Submission status: Accepted

Solution code:
import collections
import math
import operator as op
from functools import reduce
import numpy as np
import math
import bisect
import heapq


MOD = 1000000007


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd(a, b)


def get_inputs(cast_func=None):
    if cast_func is None:
        return input().split()
    else:
        return list(map(cast_func, input().split()))


def get_input(cast_func=None):
    if cast_func is None:
        return input()
    else:
        return cast_func(input())


def is_prime(n):
    if n == 1:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


def main():
    S = get_input()

    def is_palindrome(s):
        if len(s) == 1:
            return True
        else:
            first = s[:len(s)//2]
            last = s[len(s)//2 + 1:]
            return s == s[::-1] and first == first[::-1] and last == last[::-1]

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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


s = input()
N = len(s)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

s = sys.stdin.readline().rstrip()

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

if flag:
    a = s[0:(len(s)-1)//2]
    b = s[(len(s)+1)//2:]
    for i in range(len(a)//2):
        if a[i] != a[-i-1]:
            flag = False
    for j in range(len(b)//2):
        if b[j] != b[-j-1]:
            flag = False

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# B
import copy
S = list(input())
N = len(S)
S1 = copy.copy(S)
S2 = S[:(N-1)//2]
S3 = S[(N+3)//2-1:]

reverse_S1 = list(reversed(S1))
reverse_S2 = list(reversed(S2))
reverse_S3 = list(reversed(S3))

ans = 'No'

if (S1 == reverse_S1 and S2 == reverse_S2 and S3 == reverse_S3):
    ans = 'Yes'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

n = int(len(s))
s_1 = s[:(n-1)//2]
s_2 = s[((n+3)//2-1):n]
ok,ok_1,ok_2 = False,False,False
#print(s_1,s_2)
if s == s[::-1]:
    ok = True
if s_1 == s_1[::-1]:
    ok_1 = True
if s_2 == s_2[::-1]:
    ok_2 = True
if ok and ok_1 and ok_2:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def res(s):
    n = len(s)
    s_ = s[0:(n-1)//2]
    s__ = s[(n+3)//2-1:n]
    if s == s[-1::-1]:
        if s_ == s_[-1::-1]:
            if s__ == s__[-1::-1]:
                return 'Yes'
    return 'No'

s = input()
print(res(s))

Submission status: Accepted

Solution code:
import collections
import sys
import numpy as np
sys.setrecursionlimit(1000000000)
s = input()
n = len(s)
#条件1
for i in range(n):
    if s[i] == s[n-1-i]:
        continue
    else:
        print("No")
        sys.exit()
ans1 = []
#条件2
for i in range(n//2):
    ans1.append(s[i])
for i in range(len(ans1)):
    if ans1[i] == ans1[len(ans1)-1-i]:
        continue
    else:
        print("No")
        sys.exit()
#条件3
ans2 = []
for i in range((n+3)//2-1,n):
    ans2.append(s[i])
for i in range(len(ans2)):
    if ans2[i] == ans2[len(ans2)-1-i]:
        continue
    else:
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
def main(s):
    if s != s[-1::-1]:
        print("No")
        return

    n = len(s)

    p1 = s[: (n - 1) // 2]

    if p1 != p1[-1::-1]:
        print("No")
        return

    p2 = s[(n + 2) // 2 :]

    if p2 != p2[-1::-1]:
        print("No")
        return

    print("Yes")


if __name__ == "__main__":
    s = input()
    main(s)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
s = input()
cen = -(-len(s)//2)-1
ans = 'Yes'
if s != s[::-1]:
    ans = 'No'
mae = s[:cen]
if mae != mae[::-1]:
    ans = 'No'

ato = s[cen+1:]
if ato != ato[::-1]:
    ans = 'No'
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
count = 0
if s == s[::-1]:
    count += 1

if s[0:(n-1)//2] == s[0:(n-1)//2][::-1]:
    #print((n-1)//2,s[0:(n-1)//2])
    count += 1

if s[(n+3)//2-1:] == s[(n+3)//2-1:][::-1]:
    #print((n+3)//2-1,s[(n+3)//2-1:])
    count += 1


if count >= 3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def is_pal(x):
    return x == x[::-1]

if __name__ == '__main__':
    #s = input().rstrip().split(' ')
    s = input()
    N = len(s)
    print('Yes' if is_pal(s) and is_pal(s[:int((N-1)/2)]) and is_pal(s[int((N+3)/2)-1:]) else 'No')