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()
S_reverse =S[::-1]

N=len(S)
#1.回文の判定
# for i in range()
flg1 = 0
for i in range(N//2):
    if S[i] != S_reverse[i]:
        flg1+=1

# 2.前半部分は回文
S_pre =S[:N//2]
S_pre_reverse=S_pre[::-1]


flg2=0
if S_pre != S_pre_reverse:
    flg2+=1

# 3.後半部分は回文
S_last = S[int((N+3)/2)-1:]
S_last_reverse = S_last[::-1]

flg3 = 0
if S_last != S_last_reverse:
    flg3 +=1

if flg1 ==0 and flg2 ==0 and flg3==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

N = len(S)


first = ''.join(S[:int((N-1)/2)])
second = ''.join(S[int(((N+3)/2)-1):])


if first == second :
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = str(input())
t = ''
for i in range(len(s)):
    t += s[-i-1]
flag = False

if s==t:
    s1 = s[:len(s)//2]
    if len(s)%2==0:
        s2 = s[len(s)//2:]
    elif len(s)%2!=0:
        s2 = s[len(s)//2+1:]
    t1 = ''
    t2 = ''

    for i in range(len(s1)):
        t1 += s1[-1-i]
        t2 += s2[-1-i]

    if s1==t1:
        if s2==t2:
            flag = True

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

Submission status: Accepted

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

pre = S[0 : int((N-1)/2)]

bck = S[int((N+1)/2) : N]

if S == S[::-1] and pre == pre[::-1] and bck == bck[::-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):]
#print(S1,S2)
if S == S[::-1] and S1 == S1[::-1] and S2 == S2[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def kaibun(s):
  for n in range(len(s)//2):
    if s[n] == s[len(s)-n-1]:
      continue
    else:
      return False
  return True

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

Submission status: Accepted

Solution code:
S=list(input())
N=len(S)
a=False
b=False


if all(S[i]==S[N-i-1] for i in range(N)):
  a=True

if all(S[j]==S[((N-1)//2)-j-1] for j in range((N-1)//2)):
  b=True

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
mid = N//2
pal = True
part1 = []

for i in range(0, mid):
    part1.append(S[i])
for i in range(N-1, mid, -1):
    if(S[i] != part1[N-i-1]):
        pal = False

if not(pal):
    print('No')
    exit()

if len(part1) == 1:
    print('Yes')
    exit()
elif len(part1) == 2:
    if part1[0] == part1[1]:
        print('Yes')
        exit()
    else:
        print('No')
        exit()

if len(part1) % 2 == 1:
    S = part1    
    N = len(S)
    mid = N//2
    pal = True
    part1 = []

    for i in range(0, mid):
        part1.append(S[i])
    for i in range(N-1, mid, -1):
        if(S[i] != part1[N-i-1]):
            pal = False
    if(not(pal)):
        print('No')
        exit()
    else:
        print('Yes')
        exit()
else:
    S = part1    
    N = len(S)
    mid = N//2
    pal = True
    part1 = []

    for i in range(0, mid):
        part1.append(S[i])
    for i in range(N-1, mid-1, -1):
        if(S[i] != part1[N-i-1]):
            pal = False
    if(not(pal)):
        print('No')
        exit()
    else:
        print('Yes')

Submission status: Accepted

Solution code:
import sys
s = sys.stdin.readline().rstrip()
i = 0
l = len(s)
flag = True
while flag and i <= l:
  if s[i] != s[l-1]:
    flag = False
  i += 1
  l -= 1
l = len(s)
a = s[0:-(-(l-1)//2)]
i = 0
l = len(a)
while flag and i <= l:
  if a[i] != a[l-1]:
    flag = False
  i += 1
  l -= 1
b = s[(len(s) + 3)//2 - 1:]
i = 0
l = len(b)
while flag and i <= l:
  if b[i] != b[l-1]:
    flag = False
  i += 1
  l -= 1
if flag:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

if N == 3:
    if S[0] == S[2]:
        print('Yes')
    else:
        print('No')
    exit()

def is_circular(string):
    reverse = string[::-1]
    if string == reverse:
        return True
    else:
        return False

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

Submission status: Accepted

Solution code:
A = list(input())
A1 = list(reversed(A))
#print((len(A)-1)/2-1)
 
B = A[:(len(A)-1)//2]
B1 = list(reversed(B))
 
C = A[(len(A)+3)//2-1:]
C1 = list(reversed(C))
 
if A == A1 and B == B1 and C == C1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

s1 = [s[i] for i in range((n-1)//2)]
s2 = [s[i] for i in range((n+3)//2-1, n)]

sr = list(reversed(s))
s1r = list(reversed(s1))
s2r = list(reversed(s2))

if s == sr and s1 == s1r and s2 == s2r:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
s = input()
n = len(s)
s_1 = s[:(n-1)//2]
s_2 = s[(n-1)//2 +1:]
s_1_new = ''.join(list(reversed(s_1)))
s_2_new = ''.join(list(reversed(s_2)))
s_new = ''.join(list(reversed(s)))
if s == s_new and s_1 == s_1_new and s_2 == s_2_new:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = str(input())
N = int(len(S))
B = S[:(N-1)//2]
C = S[(((N+3)//2)-1):]

if S == S[::-1]:
    if B == B[::-1]:
        if C[::-1] == C:
            print("Yes")
        else:
            print("No")
    else:
            print("No")
else:
            print("No")

Submission status: Accepted

Solution code:
#coding:utf-8

s = str(input())

n = len(s)

s1 = s[:int((n - 1)/2)]
s2 = s[int((n + 1)/2):]

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

    return True


s = input().rstrip()
slen = len(s)
result = is_palindrome(s)
if result:
    bottom = int((slen - 1) / 2)
    s1 = s[:bottom]
    result = is_palindrome(s1)

if result:
    top = int((slen + 3) / 2)
    s1 = s[top - 1:]
    result = is_palindrome(s1)

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

Submission status: Accepted

Solution code:
S = input()
s = list(S)
p = []
q = []
for i in range(int((len(s)-1)/2)):
    p.append(s[i])
for i in range(int((len(s)-1)/2)):
    q.append(s[len(s)-1-i])
def abc(k):
    x = 1
    for i in range(int((len(s)-1)/2)):
        if k[i] == k[len(k)-i-1]:
            x = x*1
        else:
            x = x*0
    if x == 1:
        return 1
    else:
        return 0
if abc(p) == 1 and abc(q) ==1 and abc(s) == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


def yes():
    print("Yes")  # type: str


def no():
    print("No")  # type: str


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


def solve(S: str):
    N = len(S)

    if not kaibun(S):
        no()
        return

    s = S[:(N-1)//2]
    # print(s)
    if not kaibun(s):
        no()
        return

    s = S[(N+1)//2:]
    # print(s)
    if not kaibun(s):
        no()
        return

    yes()
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
s = input()
n = len(s)
if s==s[::-1]:
    s_2 = []
    for i in range(math.floor((n-1)/2)):
        s_2 += s[i]
    #print(s_2)
    if s_2==s_2[::-1]:
        s_3 = []
        for i in range(math.floor((n+3)/2)-1,n):
            s_3 += s[i]
        if s_3==s_3[::-1]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")

else:
    print("No")

Submission status: Accepted

Solution code:
S = str(input())
SS = S[::-1]
N = len(S)
a = int((N-1)/2)
b = int((N+3)/2)
AS = S[:a]
ASS = AS[::-1]
BS = S[b-1:N]
BSS = BS[::-1]
if S == SS and AS == ASS and BS == BSS:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def isPalindrome(sentence):
    for i in range((len(sentence))//2):
        if sentence[i] != sentence[-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+1)//2:]) else "No")

Submission status: Accepted

Solution code:
s = input()

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

n = len(s)
#print(len(s))

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

Submission status: Accepted

Solution code:
s = input()
n1 = ''
n2 = ''
for i in range( (len(s)-1)//2 ):
    n1 += s[i]

for i in range((len(s)+2)//2, len(s)):
    n2 += s[i]

if n1 == n2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


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

Submission status: Accepted

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

s = input()
n = len(s)
# print(s[:int((n - 3) / 4)])
# print(s[int((n - 1) / 2 - 1):int((n + 5) / 4 - 2):-1])
# print(s[:int((n - 1) / 2)])
# print(s[:int((n + 3) / 2 - 2):-1])
if kaibun(s) and kaibun(s[:int((n - 1) / 2)]) and kaibun(s[int((n + 3) / 2 - 1):n]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

S = input()
N = len(S)

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

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:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    s = list(input())
    r_s = list(reversed(s))
    if s != r_s:
        print('No')
        exit()
    n = len(s)
    s1 = s[:(n - 1) // 2]
    r_s1 = list(reversed(s1))
    if s1 != r_s1:
        print('No')
        exit()
    s2 = s[(n + 3) // 2 - 1:]
    r_s2 = list(reversed(s2))
    if s2 != r_s2:
        print('No')
        exit()
    print('Yes')

    
if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ip=input()

pal=ip[::-1]

a=int((len(ip)-1)//2)
b=int((len(ip)+3)//2)-1
pal1=ip[:a]
pal2=ip[b:]

if ip==pal and pal1==pal1[::-1] and pal2==pal2[::-1]:
    print('Yes',end='')
    
else:
    print('No',end='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
#s=['l','e','l','v','l','e','l']
L=int((len(s)-1)/2)
f1=0
for i in range(L):
 #   print(s[0+i])
  #  print(s[len(s)-i-1])
    if s[0+i]==s[len(s)-i-1]:
        pass
   #     print('here1')
    else:
        f1+=1
    #    print('here2')

#print(f1)
LL=L//2
f2=0
if f1==0:
    for j in range(LL):
     #   print(s[0+j])
      #  print(s[L-j-1])
        if s[0+j]==s[L-j-1]:
            pass
 #           print('here3')
        else:
            f2+=1
  #          print('here4')
else:
    f2=1

#print(f1)
#print(f2)
if f1==0 and f2==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
n_dash = int((n-1)*0.5)
pre = 1
for i in range(n):
    if s[i] == s[n-i-1]:
        pass
    else:
        pre = 0
        break
if pre == 0:
    result = 'No'
else:
    for j in range(n_dash):
        if s[j] == s[n_dash-j-1]:
            result = 'Yes'
        else:
            result = 'No'
            break
print(result)

Submission status: Accepted

Solution code:
s1 = str(input())

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

kai1 = ''
kai2 = ''

for i in range(len(s1), 0, -1):
    kai1 = kai1+s1[i-1]
for i in range(len(s2), 0, -1):
    kai2 = kai2+s2[i-1]


if s1 == kai1 and s2 == kai2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
N = len(s)
flag = 0
i = int((N-1)/2)
if s[0:i] == s[i+1:N]:
    flag = 1;
b = ""
for j in range(i):
    b += s[i-j-1]
if b == s[0:i]:
    flag += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
st = input()

n = len(st)
half = (n-1)//2

if st[0:half] == st[n-1:half:-1]:
  if half%2 == 0:
    qu = half//2
    if st[:qu] == st[half-1:qu-1:-1] and st[half+1:half+qu+1] == st[n-1:half+qu:-1]:
      print("Yes")
    else:
      print("No")  
  else:
    qu = (half-1)//2
    if st[:qu] == st[half-1:qu:-1] and st[half+1:half+qu+1] == st[n-1:half+qu+1:-1]:
      print("Yes")
    else :
      print("No") 

else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
P = 0
for i in range ((N-1)//2):
    if S[i] == S[N-1-i]:
        for k in range((N-1)//2):
            if S[k] == S[((N-3)//2)-k] and S[((N+1)//2)+k] == S[N-1-k]:
                P = P
            else:
                P += 1
    else:
        P += 1

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
P = 0
for i in range (N-1//2):
    if S[i] == S[N-1-i]:
        for k in range((N-1)//2):
            if S[k] == S[((N-1)//2)-k-1] and S[((N+1)//2)+k] == S[N-1-k]:
                P = P
            else:
                P += 1
    else:
        P += 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

S = str(input())
N = len(S)-1

N1 = int((N-1)/2)
N2 = int((N+3)/2)

s1 = S[:N]
s2 = S[:N1]
s3 = S[N2-1:N]

flag = True
for ss in [s1, s2, s3]:
    ss_l = len(ss)
    for i in range(ss_l):
        if ss[i] != ss[ss_l-i-1]:
            flag = False
            break
    if not flag:
        break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
cnt = 0
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()
n=len(s)

s1=s[0:(n-1)//2]
s2=s[(n+1)//2:n]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 159: B – String Palindrome
S = input()
N = len(S)

conds1 = (N - 1) // 2
conds2 = (N + 3) // 2
S1 = S[:conds1]
S2 = S[conds2 - 1:]

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)#7
a = 0
f = (N-1)//2
for i in range(N):
    if S[i] != S[-i-1]:
        a = 1
for i in range(f):
    if S[i] !=S[f-i-1]:
        a = 1
b = 0
for j in range((N+3)//2-1,N):
    b += 1
    if S[j] != S[N-b]:
        a = 1
if a == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = list(input())
 
a = []
b = []
for i in range(int((len(n)-1)/2)):
    a.append(n[i])
for i in range(int((len(n)+3)/2)-1,len(n)):
   b.append(n[i])
 
if a == b:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# inputを取得
S = input()
# 前半の文字列をつくる
zen = S[0 : (len(S))//2]
# 後半の文字列をつくる
kou = S[(len(S) + 1)//2 : len(S)]
flag = False

# 回文チェッカーを作成
def isKai(arg):
  res = True

  # 前からと後ろから順番に比較する
  for i in range(len(arg) // 2):
    if arg[i] != arg[-i-1]:
      # 一致しなかったらFalseにしてチェック終了
      res = False
      break
  return(res)

# 回文かどうかをチェックしてフラグに設定
if isKai(S) and isKai(zen) and isKai(kou):
  flag = True

# フラグに応じて結果を出力
if flag == True:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n//2):
  if S[i] == S[n-1-i]:
    pass
  else:
    print('No')
    break
else:
  s1 = S[0:(n//2)]
  s2 = S[(n//2+1):n]
  for j in range(len(s1)//2):
    if s1[j] == s1[len(s1)-1-j]:
      pass
    else:
      print('No')
      break
  else:
    for k in range(len(s2)//2):
      if s2[k] == s2[len(s2)-1-k]:
        pass
      else:
        print('No')
        break
    else:
      print('Yes')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
'''
n, m = map(int, input().split())
n = int(input())
A = list(map(int, input().split()))
S = input().strip()
for test in range(int(input())):
'''
inf = 100000000000000000  # 1e17

S = input().strip()
n = len(S)
for i in range(n // 4):
    if S[i] != S[n // 2 - i - 1]:
        print("No")
        sys.exit()

for i in range(n // 4):
    if S[i + n // 2 + 1] != S[n // 2 - i + n // 2]:
        print("No")
        sys.exit()
for i in range(n // 2):
    if S[i] != S[n - i - 1]:
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
s1 = list(input())
s2 = list(reversed(s1))
n = len(s1)
if s1 == s2:
    s3 = [i for i in s1[0:(n-1)//2]]
    s4 = list(reversed(s3))
    if s3 == s4:
        s5 = [i for i in s1[(n+3)//2-1:n]]
        s6 = list(reversed(s5))
        if s5 == s6:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n =int(len(s))
k1 = int((n-1) / 2)
k2 = int((n+3)/2)
median = int(n/2)
x = []
y = []
answer = 0

for i in  range(k1):
  x.append(s[i])

for i in range(k2-1,n):
  y.append(s[i])
  
for i in range(0,median):
  if x[i] == y[i]:
    answer += 1
if answer == median:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
hn = n//2
flag = True

for i in range(hn):
    if (not s[i] == s[n-i-1]) or (not s[i] == s[hn-i-1]):
        flag = False
        print("No")
        break

if flag:
    print("Yes")

Submission status: Accepted

Solution code:
S = input()

def isKaibun(X):
  flag = True
  for i in range(len(X) // 2):
    if X[i]  != X[-1 - i]:
      flag = False
      break
  return flag

flag = False
if isKaibun(S):
  if isKaibun(S[0 : len(S) // 2]):
    if isKaibun(S[(len(S) + 1) // 2 : len(S)]):
      flag = True

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

Submission status: Accepted

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

def khan(a):
    k = 0
    for i in range(len(a)//2):
        if a[i] == a[-i-1]:
            k += 1
    if k == len(a)//2:
        return True
    else:
        return False

khan(s)

sz = []
sk = []

for i in range(n//2):
    sz.append(s[i])
    sk.append(s[-i-1])

khan(sz)
khan(sk)

if khan(s) and khan(sz) and khan(sk):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = list(input())

# 回文判定
def kaibun(s) :
  for i in range(len(s)//2) :
    if s[i] != s[-(i+1)] :
      return False
      break

  return True

# 条件
S1 = S[0 : len(S)//2]
S2 = S[(len(S)+3-1)//2 : len(S)]

if kaibun(S) & kaibun(S1) & kaibun(S2) :
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()

s1 = s[:int((len(s))/2)]
s2 = s[int((len(s)+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)

S_s= S[:int((N-1)/2)]
S_e= S[int((N+3)/2)-1:]

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

Submission status: Accepted

Solution code:
def palindrome(word):
  if len(word) <= 1:
    return True
  if word[0] != word[-1]:
    return False
  return palindrome(word[1:-1])
 
word = input()
n = len(word) // 2
issuper = palindrome(word[:n]) and palindrome(word[n+1:]) and palindrome(word)
print("Yes" if issuper else "No")

Submission status: Accepted

Solution code:
S=input()
t=len(S)
w=int((t-1)/2)
l=int(len(S)/2)
n=int((t+3)/2)

Two=list(S)[0:w]
Three=list(S)[n-1:t+1]
m=int(len(Two)/2)
o=int(len(Three)/2)

count=0
counts=0
countss=0


#回文条件分岐
for i  in range(l):
    if S[i]==S[len(S)-(i+1)]:
        count +=1

#二個目の条件分岐
for i  in range(m):
    if Two[i]==Two[len(Two)-(i+1)]:
        counts +=1

#三個目の条件分岐
for i  in range(o):
    if Three[i]==Three[len(Three)-(i+1)]:
        countss +=1

if count==l and counts==m and countss==o:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
ls=S
flag=1
for i in range(N):
  if ls[i]!=ls[N-1-i]:
    flag=0
M=(N-1)//2
for i in range(M):
  if ls[i]!=ls[M-1-i]:
    flag=0
if flag==0:
  print('No')
else:
  print('Yes')

Submission status: Accepted

Solution code:
s = input()
if s[::-1] == s:
    fir = (len(s) - 1) // 2
    sec = (len(s) + 3) // 2
    if s[:fir] == s[:fir][::-1]:
        if s[sec-1:] == s[sec-1:][::-1]:
            print('Yes')
            exit()
print('No')

Submission status: Accepted

Solution code:
n = input()
x = n[::-1]
y = n[(len(n)+2)//2:]
Y = y[::-1]
z = n[0:(len(n)-1)//2]
Z = z[::-1]
if n ==x and y == Y and z ==Z:
    print("Yes")
else:print("No")

Submission status: Accepted

Solution code:
s = input()

s1 = s[:int((len(s)-1)/2)]
s2 = s[int((len(s)+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()
def kai(l):
  n = len(l)
  output = 'Yes'
  for i in range(n//2):
    if l[i] != l[n-i-1]:
      output = 'No'
  return output

ans = kai(s)
if ans == 'Yes':
  ans = kai(s[:len(s)//2])
if ans == 'Yes':
  ans = kai(s[len(s)//2+1:])
print(ans)

Submission status: Accepted

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

if S1==list(reversed(S1)) and S2==list(reversed(S2)) and S1==list(reversed(S2)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(list(s))
p = s[:(n-1)//2]
t = s[(n+1)//2:]
p1 = ""
t1 = ""
for i in reversed(range((n-1)//2)):
    p1 += p[i]
    t1 += t[i]
if t1 == t and p1 == p and s == t1 + s[(n-1)//2]+p1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

def palindrome(ss):
    if ss == ss[::-1]:
        return 1
    else:
        return 0

if palindrome(s) == 1 and palindrome(s[:int((i - 1) / 2)]) == 1 and palindrome((s[int((i + 3) / 2) - 1:i])) == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
S = list(input())
N = len(S)
A = []
B = []
for i in range((N-1)//2):
    A.append(S[i])
for j in range((N-1)//2):
    B.append(S[((N+3)//2)+(j-1)])

C = list(reversed(A))
D = list(reversed(B))
E = list(reversed(S))

if np.count_nonzero(np.array(A) == np.array(C)) == np.count_nonzero(np.array(B) == np.array(D)) == len(A) and np.count_nonzero(np.array(S) == np.array(E)) == len(S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
for i in range(N // 2):
  if S[i] != S[N - i - 1]:
    print("No")
    exit()
S_earlier = S[0 : (N - 3) // 2 + 1]
S_later = S[(N + 1) // 2 : N]

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

Submission status: Accepted

Solution code:
s = input()

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

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

Submission status: Accepted

Solution code:
str1 = input()
val = len(str1)
if len(str1) % 2!= 0:
    if str1 == str1[::-1]:
        half = str1[:int((val-1)/2)]
        shalf = str1[int((val+3)/2) -1:]
        if half == half[::-1] and shalf == shalf[::-1]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

Solution code:
n = list(input())

mae = []
usiro = []
for i in range(int((len(n)-1)/2)):
    mae.append(n[i])
for i in range(int((len(n)+3)/2)-1,len(n)):
    usiro.append(n[i])

if mae == usiro:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def check_palindrome(s):
    n = len(s)
    n_half = int(n/2)
    for i in range(n_half):
        if s[i] != s[n - 1 - i]:
            return False
    return True
S = input()
N = len(S)
N_half_end = int((N - 1)/2)
S_half_1 = S[:N_half_end]
S_half_2 = S[N_half_end + 1:]
if S_half_1 == S_half_2[::-1]:
    strong_check = True
else:
    strong_check = False
if strong_check:
    strong_check = check_palindrome(S_half_1) and check_palindrome(S_half_2)
if strong_check:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = input()
a = list(S)
L = int(len(a))
t = int(L // 2)
k = int(t // 2)
p = int(t + 2)

while L % 2 == 0:
    S = input()
    a = list(S)
    L = int(len(a))
    t = int(L // 2)
    k = int(t // 2)
    p = int(t + 2)

for i in range(t) :
    if a[i] == a[L - 1 - i]:
        continue
    else:
        print('No')
        break
else:
    for i in range(k):
        if a[i] == a[t - 1 - i]:
            continue
        else:
            print('No')
            break
    else:
        for i in range(k):
            if a[p - 1 + i] == a[L - 1 - i]:
                continue
            else:
                ptint('No')
                break
        else:
            print('Yes')

Submission status: Accepted

Solution code:
def main():
	s = str(input())
	s_1_mae = list(s[:((len(s)-1) // 2)])

	s_2 = list(s[((len(s)+3)// 2) -1 :])

	if s_1_mae == list(reversed(s_1_mae)) and s_2 == list(reversed(s_2)) and list(s) == list(reversed(list(s))):
		print("Yes")
	else:
		print("No")

if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

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

ans = "Yes"
ind1 = int((N-1)/2)
ind2 = int((N+3)/2)
for i in range(N):
    if S[i] != S[N-i-1] or S[0] != S[ind1-1] or S[ind2-1] != S[N-1]:
        ans = "No"

print(ans)

Submission status: Accepted

Solution code:
a=input()
b=len(a)
def func(x):
  if x == x[::-1]:
    return 1
  else:
    return 0
if func(a) and func(a[0:(b-1)//2]) and func(a[(b+3)//2-1:]):
  print('Yes')
else:
  print('No')