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()
lens = len(s)


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


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
S1 = S[:(len(S) - 1) // 2:]
S2 = S[(len(S) + 3) // 2 - 1:]

ans = 'Yes'
for i in range(len(S) // 2 + 1):
    if S[i] != S[-i - 1]:
        ans = 'No'
        print(ans)
        exit()

for i in range((len(S1) // 2) + 1):
    if S1[i] != S1[-i - 1]:
        ans = 'No'
        print(ans)
        exit()

for i in range(len(S2) // 2 + 1):
    if S2[i] != S2[-i - 1]:
        ans = 'No'
        print(ans)
        exit()

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

n = len(s)

first = s[0:int((n-1)/2)]
first_n = len(first)
second = s[int((n+3)/2 - 1):]
second_n = len(second)
flag = True

for sn in range(int(n/2)):
    if not s[sn] == s[-sn-1]:
        flag = False

for sn in range(int(first_n/2)):
    if not first[sn] == first[-sn-1]:
        flag = False

for sn in range(int(second_n/2)):
    if not second[sn] == second[-sn-1]:
        flag = False

if flag:
    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 :]
# print(S, S1, S2)


def f(a):
    res = "".join(list(reversed(a)))
    return res


if S == f(S) and S1 == f(S1) and S2 == f(S2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
n=int(len(s))
S=list(s)
l=int(0)
f=int(0)

while l<((n-1)/2):
  if S[l]==S[int(((n+1)/2)+l)]:
    l+=1
    continue
  else:
    f=1
    break
    
if f==1:
  print('No')
else:
  print('Yes')

Submission status: Accepted

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

A=S[0:a]
B=S[b-1:n]

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

Submission status: Accepted

Solution code:
import sys
import numpy as np

s = input()

while True:
    if (s != s[::-1]):
        print("No")
        break
    end = (len(s)-1) // 2
    e1 = s[:end]
    if (e1 != e1[::-1]):
        print("No")
        break
    start = (len(s)+3) // 2 - 1
    e2 = s[start:]
    if (e2 != e2[::-1]):
        print("No")
        break
    print("Yes")
    break

Submission status: Accepted

Solution code:
if __name__ == '__main__':

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

Submission status: Accepted

Solution code:
str = input()

if str != str[::-1]:
    print("No")
else:
    fstr = str[:(len(str)-1)//2]
    tstr = str[(len(str)+3)//2-1:]

    if fstr == fstr[::-1] and tstr == tstr[::-1]:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
import math
import fractions

s = stdin.readline().rstrip()
rs = s[::-1]
n = int((len(s) - 1) / 2)
s2 = s[0:n]
rs2 = s2[::-1]
n2 = int((len(s) + 3) / 2) - 1
n22 = int(len(s))
s3 = s[n2:n22]
rs3 = s3[::-1]

if s == rs and s2 == rs2 and s3 == rs3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
s_list = list(s)
check = False
if s_list == s_list[::-1]:
  s_list_mae = s_list[ : len(s_list)//2 ]
  s_list_usiro = s_list[len(s_list)//2 + 1 : ]
  if s_list_mae == s_list_mae[::-1] and s_list_usiro == s_list_usiro[::-1]:
    check = True
if check == True:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

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

for i in range((n-1)//2):
  if s[i] != s[(n-1)//2-i-1]:
    flg = 0
  if s[(n+3)//2+i-1] != s[n-i-1]:
    flg = 0

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

Submission status: Accepted

Solution code:
import copy
s = input()

mae = s[:len(s) // 2]
ushiro = s[len(s) // 2 + 1:]
ushiro2 = copy.deepcopy(ushiro[::-1])

if mae == ushiro:
    print('Yes')
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a_str = input()
r_str = a_str[::-1]
n = (len(a_str) - 1) // 2

head = a_str[0:n]
back = a_str[len(a_str) - n:]

if a_str == r_str:
    if head == head[::-1] and back == back[::-1]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
from sys import stdin


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


# N, A, B = [int(x) for x in stdin.readline().rstrip().split()]
# A,B = [int(x) for x in stdin.readline().rstrip().split()]
S = stdin.readline().rstrip().split()[0]
# print(S)
s1 = S[0:(len(S)-1)//2]
s2 = S[(len(S)+1)//2:len(S)]
# print(s1)
# print(s2)
if is_kaibun(S) is True:
    if is_kaibun(s1) is True:
        if is_kaibun(s2) is True:
            print("Yes")
            exit(0)
print("No")

Submission status: Accepted

Solution code:
s = input()
l = len(s)
def test(s):
    l = len(s)
    sub = l//2
    return s[:sub][::-1] == s[-1*sub:]
if test(s[:(l-1)//2]) and test(s):
    print('Yes')
elif l == 3 and test(s):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))
sys.setrecursionlimit(10 ** 7)

def main():
    s = ns()
    n = len(s)
    mid = s[:(n - 1) // 2]
    san = s[(n + 3) // 2 - 1:]
    
    if s == s[::-1]:
        if mid == mid[::-1]:
            if san == san[::-1]:
                print("Yes")
                return
    print("No")    


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

s=input()
s=list(s)

N=len(s)
m=int((N-1)/2)

kaibun=True
for i in range(m):
    if s[N-1-i]!=s[i] or s[i]!=s[m-i-1] or s[N-1-i]!=s[m+1+i]:
        kaibun=False
        break

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

Submission status: Accepted

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

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

s_2 = s[:int((l-2)/2+1)]
s_3 = s[int((l+3)/2-1):]

if ispalindrome(s) == 1 and ispalindrome(s_2) == 1 and ispalindrome(s_3) == 1: 
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

s1 = S[0]
index_f = (len(S)-1)/2
s2 = S[int(index_f)-1]

index_o = (len(S)+3)/2
s3 = S[int(index_o) - 1]
index_l = len(S) - 1
s4 = S[int(index_l)]

ans = 'No'

s_f = S[0:int(index_f)]
s_l = S[int(index_o) - 1:]

# print(s1)
# print(s2)
# print(s3)
# print(s4)
# print(s_f)
# print(s_l)

if (s_f == s_l) and (s1 == s2) and (s3 == s4):
    ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
kai = list(input())

#回文かどうか
flag = 0
for i in range(len(kai)):
    if kai[i] != kai[-i-1]:
        flag = 1

a = kai[:int(len(kai)/2)]
#1~半分，後半半分回文
for i in range(len(a)):
    if a[i] != a[-i-1]:
        flag = 1
b = kai[int(len(kai)/2)+1:]

for i in range(len(b)):
    if b[i] != b[-i-1]:
        flag = 1

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

Submission status: Accepted

Solution code:
s = input()


def is_kaibun(s):
    """
    if len(s) == 1:
        return True

    l = [0] * (ord("z") - ord("a") + 1)
    for c in s:
        l[ord(c)-ord("a")] += 1

    odd_cnt = 0
    for i in range(len(l)):
        if l[i] % 2 == 1:
            odd_cnt += 1
            if odd_cnt >= 2:
                return False
    return True
    """
    rev_s = s[::-1]
    if rev_s == s:
        return True
    else:
        return False


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

Submission status: Accepted

Solution code:
S = input()
reS = S[::-1]
if S != reS:
    print("No")
    exit()
N = len(S)
minS = S[:(N - 1) // 2]
minreS = minS[::-1]
maxS = S[(N + 2) // 2:]
maxreS = maxS[::-1]
if minS == minreS and maxS == maxreS:
    print("Yes")

else:
    print("No")

Submission status: Accepted

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


def main():
    s = input()
    s = s.strip()
    n = len(s)
    a = s[0:(n-1)//2]
    b = s[(n+3)//2-1:n]

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

    for i in range(len(a)//2):
        if a[i] != a[len(a)-i-1]:
            print('No')
            return

    for i in range(len(b)//2):
        if b[i] != b[len(b)-i-1]:
            print('No')
            return

    print('Yes')


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8

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

S = input().rstrip('\n')
N = len(S)

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

Submission status: Accepted

Solution code:
S = list(input())

N = len(S)
flag = 0
#回文か
for i in range(int(N/2)):
    if S[i] != S[N-i-1]:
        flag = 1
        break

for j in range(int(((N-1)/2)/2)):
    if S[i] != S[int(((N-1)/2)-i-1)]:
        flag = 1
        break

for k in range(int((N - ((N+3)/2)))):
    if S[int((N+3)/2 -1)] != S[N-i-1]:
        flag = 1
        break

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

Submission status: Accepted

Solution code:
def is_kaibun(s):
    if (s == s[::-1]):
        return True
    else:
        return False


def b():
    S = str(input())
    N = len(S)
    k1 = is_kaibun(S)
    k2 = is_kaibun(S[:int((N-1)/2)])
    k3 = is_kaibun(S[int((N+1)/2):])

    if (k1 and k2 and k3):
        print('Yes')
    else:
        print('No')


##########
if __name__ == "__main__":
    b()

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
flg = True
for i in range((N-1)//2):
  if S[i] != S[N-1-i]:
    flg = False
for i in range((N-1)//4):
  if S[i+((N+3)//2)-1] != S[N-1-i]:
    flg = False
    
if flg:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def func(s):
    # print("xxx func")
    l = len(s)
    z = int((l + 1) / 2)
    same = True
    for i in range(z):
        # print(s[i], s[l - i - 1])
        if s[i] != s[l - i - 1]:
            same = False
    return same


s = input()
l = len(s)
x = int((l - 1) / 2)
y = int((l + 3) / 2)
# print(s[:x])
# print(s[y - 1 :])
if func(s) and func(s[:x]) and func(s[y - 1 :]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

st = s[0:int((n-1)/2)]
en = s[int((n+3)/2)-1:n]

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

Submission status: Accepted

Solution code:
#  s = int(input())
#  s = map(int, input().split())
#  s = list(map(int, input().split()))

def main():
  s = list(input())
  n = len(s)
  m = (n-1)//2
  l = (n+3)//2
  
  
  f = s==s[::-1]
  
  t = s[:m]
  
  g = t == t[::-1]
  
  r = s[l-1:]
  
  h =  r == r[::-1]
  
  
  
  if f and g and h:
    print('Yes')
  else:
    print('No')
		

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
from copy import copy
s = list(input())

a = int((len(s) - 1)/2)
b = int((len(s) + 3)/2)
sa = s[:a]
sb = s[b-1:]

judge1 = s[::-1] == s
judge2 = sa[::-1] == sa
judge3 = sb[::-1] == sb

if judge1 and judge2 and judge3:
    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]:
        continue
    else:
        print("No")
        exit()
        
s_f = s[:len(s)//2]
s_b = s[len(s)//2 + 1:]


for i in range(len(s_f)//2):
    if s_f[i] == s_f[-i-1]:
        pass
    else:
        print("No")
        exit()
    
    if s_b[i] == s_b[-i-1]:
        pass
    else:
        print("No")
        exit()
else:
    print("Yes")

Submission status: Accepted

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


def isloop(S):
    i = 0
    N = len(S)
    if i == N-1-i:
        return True
    while S[i] == S[N-1-i]:
        i += 1
        if i == N-1-i or i == N-i:
            return True
    return False


if isloop(S) and isloop(S1) and isloop(S2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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


def resolve():
    S = list(input())

    if not ispalindrome(''.join(S)):
        print('No')
        return

    num = len(S)
    half = num // 2

    half_1 = S[0:half]
    half_2 = S[half + 1:]

    if not ispalindrome(''.join(half_1)):
        print('No')
        return

    if not ispalindrome(''.join(half_2)):
        print('No')
        return

    print('Yes')


resolve()

Submission status: Accepted

Solution code:
s = input()
flag = True
l = len(s)
if s != s[::-1]:
    flag = False
    #print('a')
#print(s,s[::-1])
if s[:(l-1)//2] != s[:(l-1)//2][::-1]:
    flag = False
    #print('b')
#print(s[:(l-1)//2],s[:(l-1)//2][::-1])
if s[(l+3)//2-1:] != s[(l+3)//2-1:][::-1]:
    flag = False
    #print('c')
#print(s[(l+3)//2-1:],s[(l+3)//2-1:][::-1])
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
def palindrome(string): return 0 if string==string[::-1] else 1

N = len(S)
flag = False
if palindrome(S) == 0:
    if palindrome(S[:int((N - 1)/2)]) == 0:
        if palindrome(S[int((N + 3)/2 - 1):]) == 0:
            flag = True
if flag:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
answer = 'Yes'
N = len(S)
S2 = S[0:(N-1)//2]
N2 = len(S2)
S3 = S[(N+3)//2-1:]
N3 = len(S3)
for i in range(N//2):
  if ( S[i] == S[-(i+1)]):
    answer = 'Yes'
  else:
    answer = 'No'
    break
if answer == 'Yes':
  for i in range(N2//2):
    if( S2[i] == S2[-(i+1)] and S3[i] == S3[-(i+1)]):
      answer = 'Yes'
    else:
      answer = 'No'
      break
print(answer)

Submission status: Accepted

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

ans = 'Yes'
for i in range(n//2):
  if s[i] != s[-i-1] or s[i] != s[-i-1+int((n-1)/2)] or s[i+int((n+1)/2)] != s[-i-1]:
  	ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
def isp(s): 
    rev = ''.join(reversed(s)) 
    if (s == rev): 
        return True
    return False
x=input()
y=len(x)
a=(len(x)-1)//2
b=(len(x)+3)//2
if(isp(x) and isp(x[:a]) and isp(x[b-1:])):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""def power(x, y): 
    res = 1
    x=x
    while (y > 0): 
        if ((y & 1) == 1) : 
            res = (res * x) 
        y = y >> 1
        x = (x * x)
    return res""" 
"""def fact(n):
    if(n==0):
        return 1
    if(n==1):
        return 1
    return fact(n-1)+fact(n-2)"""

import math
#import combinations
#t=int(input())
#for _ in range(t):
#n=int(input())
arr=list(input().strip())
#n,m=map(int,input().split())
#count=0
n=len(arr)
flag=1
for i in range(n//2):
    if(arr[i]!=arr[n-i-1]):
        flag=0
        break
for i in range(((n-1)//2)//2):
    if(arr[i]!=arr[(n-1)//2-i-1]):
        flag=0
for i in range((n+3)//2 - 1 ,n):
    if(arr[i]!=arr[n-i-1]):
        flag=0
if(flag==1):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

    N = len(S)

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

    S2 = S[0:int(N/2)]
    N2 = len(S2)

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

    S3 = S[int((N+3)/2)-1:]
    N3 = len(S3)

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

    print('Yes')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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


def solve(S: str):
    N = int(len(S))
    ans = YES

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

    S_left, S_right = S[:N//2], S[N//2 + 1:]

    for i in range(N//2//2):
        if S_left[i] != S_left[-1 - i]:
            ans = NO
            break
        if S_right[i] != S_right[-1 - i]:
            ans = NO
            break
    print(ans)


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S=input()
N=len(S)
l=int((N-1)/2)
ans="Yes"
for i in range(l):
    if(S[i]!=S[N-1-i]):
        ans="No"
Smae=S[0:l]
Susi=S[l+1:N]
m=int(((N-1)/2)/2)
for i in range(m):
    if(Smae[i]!=Smae[l-1-i]):
        ans="No"
    if(Susi[i]!=Susi[l-1-i]):
        ans="No"
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力

def isKaibun(a):
    for i in range(int(len(a)/2)):

        if a[i]!=a[len(a)-i-1]:

            return 0
    return 1
a = input()

if isKaibun(a)*isKaibun(a[0:int((len(a)-1)/2)])*isKaibun(a[int((len(a)+3)/2)-1:len(a)])==1:
    print("Yes")
else :
    print("No")
# スペース区切りの整数の入力

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
S=input()
lens=len(S)
half=lens//2
haha=half//2
if lens%2==0:
    if S[:half]==S[half:]:
        if half%2==0:
            if S[:haha]==S[haha:half][::-1]:
                print('Yes')
            else:
                print('No')
        else:
            if S[:haha]==S[haha+1:half][::-1]:
                print('Yes')
            else:
                print('No')
    
else:
    if S[:half]==S[half+1:]:
        if half%2==0:
            if S[:haha]==S[haha:half][::-1]:
                print('Yes')
            else:
                print('No')
        else:
            if S[:haha]==S[haha+1:half][::-1]:
                print('Yes')
            else:
                print('No')
    else:
        print('No')

Submission status: Accepted

Solution code:
s = input().split()[0]
n = len(s)
l = s[:n//2]
r = s[n//2+1:]
cnt = 0
for i in range(n//2):
    if l[i] == l[n//2 - 1 - i]:
        cnt += 1
    if r[i] == r[n//2 - 1 - i]:
        cnt += 1
if l == r and cnt == n - 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

    for i in range(n // 2):
        if s[i] != s[n - 1 - i]:
            print("No")
            return
    
    for i in range((n - 1) // 2):
        if s[i] != s[(n - 1) // 2 - 1 - i]:
            print("No")
            return
    
    for i in range((n + 3) // 2, n):
        if s[i] != s[n - 1 - i]:
            print("No")
            return
    
    print("Yes")

    return

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
S = input()

if S == S[::-1]:
    rhalf = S[0:int((len(S)-1)/2)]
    if rhalf == rhalf[::-1]:
        lhalf = S[int((len(S)+3)/2)-1:]
        if lhalf == lhalf[::-1]:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
S=str(input())
N=len(S)
M=int((N-1)/2)
f=True
L=""
for i in range(M):
	if S[i]!=S[-i-1]:
		f=False
	else:
		L+=S[i]	
for i in range(int(len(L)//2)):
	if L[i]!=L[-i-1]:
		f=False
if f==False:print("No")
else:print("Yes")

Submission status: Accepted

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

res = True 

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ensure(s):
    flag = 0
    c = len(s)//2
    for i in range(c):
        if s[i]!=s[-1*(i+1)]:
            flag = 1
            continue
    return flag

S = input()
N = len(S)

flag1 = ensure(S)

flag2 = ensure(S[:int(((N-1)/2))])

flag3 = ensure(S[int(((N+3)/2)-1):])

ans = 'Yes' if flag1==0 and flag2==0 and flag3==0 else 'No'
print(ans)

Submission status: Accepted

Solution code:
S = input()
l = int(len(S)/2)
front = S[:l]
back = S[(l+1):]


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

Submission status: Accepted

Solution code:
s=input()
a=(len(s)-1)//2-1
b=[]
for i in range(0,a):
    if s[i]!=s[len(s)-i-1]:
        b.append(1)
    elif s[i]!=s[a-i]:
        b.append(1)
    else:
        b.append(0)
if 1 in b:
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s=input()
s_1=s[0:int((len(s)-1)/2)]
s_2=s[int((len(s)+3/2))-1:len(s)]
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()
if s==s[-1::-1] and s[:(len(s)-1)//2]==s[(len(s)-1)//2-1::-1] and s[(len(s)+3)//2-1:]==s[-1:-(len(s)-1)//2-1:-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
flag=0
s = input()
a = [str(c) for c in s]
for i in range(int((len(s)-1)/2)):
  if a[i]!=a[int((len(s)+1)/2+i)] or a[i]!=a[int((len(s)-1)/2-1-i)]:
    flag=1
    break
if flag==0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def kaibun(s):
    flag = 1
    ss = list(s)
    sss = ss.copy()
    ss.reverse()
    if sss != ss:
        flag = 0
    return flag

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

if kaibun(S)+kaibun(s1)+kaibun(s2) == 3:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

print("Yes" if a*b*c == 1 else "No")

Submission status: Accepted

Solution code:
import numpy as np
import fractions
import decimal
from collections import deque

s=str(input())
a=s[:(len(s)-1)//2]
# print(a)
if(s!=s[::-1]):
    print("No")
    exit(0)
if(a!=a[::-1]):
    print("No")
    exit(0)
b=s[(len(s)+3)//2-1:]
# print(b)
if(b!=b[::-1]):
    print("No")
    exit(0)

print("Yes")

Submission status: Accepted

Solution code:
S = input()
result = 'Yes'
N = len(S)
S = '-' + S
for i in range(1, N + 1):
    if S[i] != S[N - i + 1]:
        result = 'No'
for i in range(1, (int((N - 1) / 2)) + 1):
    if S[i] != S[int((N - 1) / 2) - i + 1]:
        result = 'No'
for i in range(int((N + 3) / 2), N + 1):
    if S[i] != S[N - i + 1]:
        result = 'No'
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

ans="No"
if S==S[::-1]:
  if S[0:(N-1)//2] == S[:(N-1)//2:-1]:
    if S[(N+3)//2-1:] == S[:(N+3)//2-2:-1]:
      ans="Yes"
print(ans)

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
n1 = int((n - 1) / 2)
s1 = s[:n1]
n2 = int((n + 3) / 2) - 1
s2 = s[n2:]
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[0:((N-1)//2)]
S2 = S[(((N+3)//2)-1):N]
if S == S[::-1] and  S1 == S1[::-1] and  S2 == S2[::-1]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
s = input()
a = s[::-1]
if s == a:
    t = s[0:(len(s)-1)//2]
    b = t[::-1]
    if t == b:
        u = s[(len(s)+3)//2-1:]
        c = u[::-1]
        if u == c:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
#print(a,b,u,c)

Submission status: Accepted

Solution code:
import sys,math
sys.setrecursionlimit(10**9)
from collections import defaultdict
 
IA = lambda: map(int,input().split())
IAS= lambda: map(str,input().split())
 
s=input()

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

if len(s)%2==0:
    print("No")
else:
    if check(s)==0:
        print("No")
    else:
        n=len(s)
        s1=[s[i] for i in range(0,n//2)]
        s2=[s[i] for i in range(n//2+1,n)]
        if check(s1)==1:
            print("Yes")
        else:
            print("No")

Submission status: Accepted

Solution code:
hoge=input()
n=len(hoge)
if(hoge!=hoge[::-1]):
  print("No")
  exit()
aaa=hoge[1+n//2:]
bbb=hoge[:n//2]
ccc=aaa[::-1]
ddd=bbb[::-1]
if(aaa==ccc and bbb==ddd):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

judge = 'Yes'

index_left = (N - 1) // 2
index_right = (N + 3) // 2

kaibunn_left = list(S[:index_left])
kaibunn_right = list(S[index_right - 1 :])


for i in range(N):
    s = list(S)
    s_begin = s[i]
    s_end = s[N - 1 - i]
    
    if (s_begin != s_end):
        judge = 'No'
        break


for i in range(index_left):
    n = len(kaibunn_left)
    s_begin = kaibunn_left[i]
    s_end = kaibunn_left[n - 1 - i]
    
    if (s_begin != s_end):
        judge = 'No'
        break


for i in range(len(kaibunn_right)):
    n = len(kaibunn_right)
    s_begin = kaibunn_right[i]
    s_end = kaibunn_right[n - 1 - i]
    
    if (s_begin != s_end):
        judge = 'No'
        break

print(judge)

Submission status: Accepted

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

s1 = S[0:(N-1)//2]
s2 = S[((N+3)//2)-1:]
s1_r = ''.join(list(reversed(s1)))
s2_r = ''.join(list(reversed(s2)))

ans = 'No'

if s1==s2==s1_r==s2_r:
    ans = 'Yes'

print(ans)

Submission status: Accepted

Solution code:
a = input()
ju = True
n=len(a)
for i in range(n):
	if a[i] != a[-i-1]:
		ju=False
		
m=int((n-1)/2)
for i in range(m):
	if a[i] != a[m-1-i]:
		ju=False
		
l=int((n+3)/2)
l2= n-l+1
for i in range(l2):
	if a[l-1+i] != a[-i-1]:
		ju=False

if ju==False:
	print("No")
else:
	print("Yes")