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().strip()
y, n = "Yes", "No"
mid = len(s)//2
if s[0:mid] == s[mid+1:len(s)]:
    print(y)
else:
    print(n)

Submission status: Accepted

Solution code:
s=input()
n=len(s)
end_1=(n-1)//2
s_1=s[0:end_1]
end_2 = (n+3)//2
s_2=s[end_2-1::]
#print("s_1",s_1)
#print('s_2',s_2)
if s_1 == s_1[::-1] and s_2 == s_2[::-1] and s==s[::-1]:
	print('Yes')
else:
	print('No')

Submission status: Accepted

Solution code:
#入力
S = str(input())

N = int(len(S))
kaibun1 = int((N-1)/2)
kaibun2 = int((N+2)/2)


#普通の回文判定

#print(S[0:kaibun1],S[kaibun2:N])

if S[0:kaibun1] == S[kaibun2:N]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S=list(input())

t=True
for i in range(int(len(S)/2)):
    if S[i]!=S[(i+1)*-1]:

        t=False
        break

s_max =len(S)-1
S_befor = S[0:int(s_max/2)]
for i in range(int(len(S_befor)/2)):
    if S_befor[i]!=S_befor[(i+1)*-1]:

        t=False
        break

S_after = S[int((len(S)+3)/2):-1]
for i in range(int(len(S_after)/2)):
    if S_after[i]!=S_after[(i+1)*-1]:
        t=False
        break

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

Submission status: Accepted

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

t = s[::-1]
c = t[:(n-1)//2]
d = t[(n+3)//2-1:]
if (a==b) and (b==c) and (c==d) and (d==a):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def main():
    S = input()
    N = len(S)
    c = N // 2
    for i in range(c):
        if S[i] == S[-(i + 1)]:
            continue
        print("No")
        return

    for i in range(c // 2):
        if S[i] == S[c - i - 1]:
            continue
        print("No")
        return

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

Submission status: Accepted

Solution code:
s = input()
n = (len(s)-1)//2
s = list(s)
rs = s[::-1]
lw = s[0:n]
rw = s[n+1:]
lws = lw[::-1]
rws = rw[::-1]

if s != rs:
    print("No")
elif (rw != rws) or (lw != lws):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

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

Submission status: Accepted

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

flag = True

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

if flag==True:
  right = int((N-1) / 2)
  subS = S[0:right]
  for i in range(int(len(subS)/2)):
    if subS[i]!=subS[-1-i]:
      flag = False
      break

if flag==True:
  left = int((N+3) / 2)
  subS = S[left-1:N]
  for i in range(int(len(subS)/2)):
    if subS[i]!=subS[-1-i]:
      flag = False
      break

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

Submission status: Accepted

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

s = input()
n = int(len(s)/2)

s1 = s[:n]
s2 = s[n+1:]
s2 = s2[::-1]

if is_kaibun(s) == True:
  if is_kaibun(s1) == True:
    if is_kaibun(s2) == True:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

Solution code:
def is_permutation(s):
    if len(s) == 2 and s[0] != s[1]:
        return False

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

def strong_permutation(s):
    if not is_permutation(s): return False

    last = int((len(s) - 1) / 2)
    s2 = s[:last]
    if not is_permutation(s2): return False

    start = int((len(s) + 3) / 2 - 1)
    s3 = s[start:]
    if not is_permutation(s3): return False

    return True

S = input()
if strong_permutation(S):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
rS = [_ for _ in S[::-1]]
S1 = [S[i] for i in range((N-1)//2)]
S2 = [S[i] for i in range((N+1)//2,N)]
rS1 = [_ for _ in S1[::-1]]
rS2 = [_ for _ in S2[::-1]]

if S == rS and S1 == rS1 and S2 == rS2:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

    tmp_s = S.copy()
    tmp_s.reverse()

    if S == tmp_s:
        tmp = S[: (len(S) - 1) // 2]
        tmp_s = tmp.copy()
        tmp_s.reverse()
        if tmp == tmp_s:
            tmp = S[(len(S) + 3) // 2 - 1 :]
            tmp_s = tmp.copy()
            tmp_s.reverse()
            if tmp == tmp_s:
                print("Yes")
                return
    print("No")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = [i for i in list(input())]

def kaibun(t):
    c = 0
    for i in range(int((len(t) + 1) / 2)):
        if t[i] == t[len(t) - 1 - i]:
            c += 1
    
    if c == int((len(t) + 1) / 2):
        return True
    else:
        return False

f1 = kaibun(s)
f2 = kaibun(s[0:int((len(s) - 1) / 2)])
f3 = kaibun(s[int((len(s) + 1) / 2):len(s)])

if f1 and f2 and f3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
i=input()
N=len(i)
k=0
for j in range (0,N):
    if i[j]!=i[N-1-j]:
        k+=1
for l in range (0,(N-1)//2):
    if i[l]!=i[(N-3)//2-l]:
        k+=1
for m in range (0,(N-1)//2):
    if i[m+(N+1)//2]!=i[N-1-m]:
        k+=1
if k==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def isa(s):
    if s == s[::-1]:
        return 1
    else:
        return 0

s = input()
n =int( (len(s)-1)/2)
list = list(s)
list1 = list[0:n]
list2 = list[n+1:2*n+1]

if list1 != list2:
    print('No')
elif isa(','.join(list1)) != 1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

num = (N-1)/2
num1 = (N+2)/2

if(S[:int(num)]==S[int(num1):]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()

# def check(s):
#     if len(s) == 1:
#         return True

#     before = s[: len(s) // 2]
#     if len(s) % 2 == 0:
#         after = s[((len(s) // 2)):]
#     else:
#         after  = s[((len(s) // 2) + 1):]

#     if before == after:
#         return True
#     else:
#         return False

# if check(s) and check(s[:(len(s)//2)]):
#     print("Yes")
# else:
#     print("No") 

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


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

Submission status: Accepted

Solution code:
s = input()

res = "Yes"
for i in range(len(s)):
    if s[i] != s[-(i+1)]:
        res = "No"
        break

if res == "Yes":
    mx = int((len(s)-1)/2)
    for i in range(mx):
        if s[i] != s[mx-i-1]:
            res = "No"
            break

if res == "Yes":
    mx = len(s)-1
    j = 0
    for i in range(int((len(s)+3)/2)-1, len(s)):
        if s[i] != s[(mx - j)]:
            res = "No"
            break
        j = j + 1

print(res)

Submission status: Accepted

Solution code:
S=input()

flag_1=0
for i in range(int(len(S)/2)):
    if S[i]==S[len(S)-i-1]:
        flag_1+=1
        
if flag_1==int((len(S)-1)/2):
    if S[int(len(S)/2)-1]==S[0] and S[int(len(S)/2)+1]==S[len(S)-1]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

ans = 'Yes'
for i in range(0,n//2):
    if str_list[i] != str_list[n//2-i-1]:
        ans = 'No'

for j in range(n//2+1,n):
    if str_list[i] != str_list[-i-1]:
        ans = 'No'

for i in range(n):
    if str_list[i] != str_list[-i-1]:
        ans = 'No'

print(ans)

Submission status: Accepted

Solution code:
import sys

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

for i in range(N):
    if S[i] != S[N-1-i]:
        print('No')
        sys.exit()

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

NNN = (N+3)//2
j = 0
for i in range(NNN-1,N):
    if S[i] != S[N-j-1]:
        print('No')
        sys.exit()
    j += 1

print('Yes')

Submission status: Accepted

Solution code:
s=list(input())
N=len(s)
if N==3:
  if s[0]==s[2]:
    print("Yes")
  else:
    print("No")
else:
  tmp=s[0:int((N-1)/2)]
  tmp_rev=tmp[::-1]

  tmp2=s[int((N+3)/2)-1:]
  tmp2_rev=tmp2[::-1]

  if tmp==tmp_rev and tmp2==tmp2_rev and s==s[::-1]:
    print("Yes")
  else:
    print("No")

Submission status: Accepted

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

front = s[0:int((n-1)/2)]
back = s[int((n+1)/2):]
if front == back[::-1] and front == back:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = list(str(input()))
length1 = int((len(S) -1) / 2)
length2 = int((len(S) + 1) / 2)

if S[0:length1] == S[length2:]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = str(input())

n = len(s)

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

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

if palindrome(s) and palindrome(s2) and palindrome(s3):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

n = len(s)
s1 = []
s2 = []
count = 0

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


for j in range((n + 3)//2 - 1,n):
    s2.append(s[j])

if s == list(reversed(s)) and s2 == list(reversed(s2)) and s1 == list(reversed(s1)):
    count = 1

# print(reversed(s))
# print(s1)
# print(s2)
# print(count)
if count == 1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import math
S=input()

N=math.floor(len(S))
N1=math.floor(((len(S)-1)/2))
N2=math.floor(((len(S)+3)/2)-1)

S1=S[:N1]
S2=S[N2:N]

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
S = input().strip()
Sr=''.join(list(reversed(S)))
N=len(S)
S1=S[:int((N-1)/2)]
S1r=''.join(list(reversed(S1)))
S2=S[int((N+3)/2)-1:]
S2r=''.join(list(reversed(S2)))
if S==Sr and S1 ==S1r and S2==S2r:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()

last=(len(S)-1)//2
S1=S[0:last]

start=(len(S)+3)//2
S2=S[start-1:len(S)]

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

Submission status: Accepted

Solution code:
s_list = list(input())
l = len(s_list)

t = False
if l%4 == 1:
    c_num = int((l-1)/4)
    c_l = s_list[:c_num]
    t_1 = s_list[c_num:2*c_num][::-1]
    t_2 = s_list[2*c_num+1:3*c_num+1]
    t_3 = s_list[3*c_num+1:][::-1]

    if c_l == t_1 == t_2 == t_3:
        t = True

if l % 4 == 3:
    c_num = int((l - 3) / 4)
    c_l = s_list[:c_num]
    t_1 = s_list[c_num+1 :2 * c_num + 1][::-1]
    t_2 = s_list[2 * c_num + 2:3 * c_num + 2]
    t_3 = s_list[3 * c_num + 3:][::-1]

    if (c_l == t_1 == t_2 == t_3) and (s_list[c_num] == s_list[3*c_num+2]):
        t = True

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
X = (N-1)//2
flag = True
bun = True
if X%2 == 0:
  bun = False

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

Submission status: Accepted

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

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        # for line in sys.stdin:
        #     lines.append(line)
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    s = lines[0]

    return (s, )


def solve(s, ):

    n = len(s)
    ma = (n - 1) // 2 
    mb = (n + 3) // 2

    def test_text(text):
        if debug:
            log("text=%s" % text)
        n = len(text) 
        m = (n - 1) // 2
        result = True
        for i in range(m+1):
            if debug:
                log('(s[%d], s[%d])=(%s, %s)' % (i, -(i+1), s[i], s[-(i+1)]))
            if text[i] != text[-(i+1)]:
                result = False
                break

        return result

    if debug:
        log("s =%s" % s)
        log("ma=%d, sa=%s" % (ma, s[:ma]))
        log("mb=%d, sb=%s" % (mb, s[mb-1:]))

    result1 = test_text(s) 
    result2 = test_text(s[:ma]) 
    result3 = test_text(s[mb-1:]) 
    if debug:
        log('result1=%s, result2=%s, result3=%s' % (result1, result2, result3))

    result  = 'No'
    if result1 and result2 and result3:
        result = 'Yes'


    
    return result
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

Solution code:
word = list(input())
new_word = list(reversed(word))
front = word[0:int((len(word)-1)/2)] 
new_front = list(reversed(front))
rear = word[int(((len(word)-1)/2)+1):]
new_rear = list(reversed(rear))
ans = 0
if front == new_front and rear == new_rear:
  ans += 1
if word == new_word:
  ans += 1
  
if ans == 2:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
frag=0
a = list(input())
N=len(a)-1
for i in range(int(N/2)):
    if a[i]!=a[N-i]:
        frag=1
        break
if frag==0:
    for i in range(int(N/4)):
        if a[i]!=a[int(N/2-i-1)] or a[N-i]!=a[int(N/2+i+1)]:
            frag=1
            break
if frag==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
# coding:utf-8

def palindrome(string): 
    return 0 if string==string[::-1] else 1
    
def main():
    s = input()
    n = int(len(s))

    temp = []
    temp2 = []

    for i in range(int((n-1)/2)):
        temp.append(s[i])
    temp = ''.join(temp)
        
    for i in range(int((n+3)/2)-1, n):
        temp2.append(s[i])
    temp2 = ''.join(temp2)

    if (palindrome(temp) == 0 and palindrome(temp2) == 0) and palindrome(s) == 0:
        print("Yes")
    else: print("No")

if __name__ == '__main__' :
    main()

Submission status: Accepted

Solution code:
S = str(input())
flag = 0
a = S[:(len(S)-1)//2]
b = S[(len(S) + 3)//2-1:]

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

Submission status: Accepted

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

inS = str(input()) 
N = len(inS)

if(isKaibun(inS) and isKaibun(inS[0:(N-1)//2]) and isKaibun(inS[(N+1)//2:N])):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
n = input()

x = len(n)

if n == n[::-1]:

    if n[:((x-1)//2)] == n[:((x-1)//2)][::-1]:

        if n[((x+3)//2)-1:] == n[((x+3)//2)-1:][::-1]:

            print('Yes')

        else:

            print('No')

    else:

        print('No')

else:

    print('No')

Submission status: Accepted

Solution code:
S = list(input())
N = int(len(S))
revS = []
S2 = []
revS2 = []

S3 = []
revS3 = []
def check(S,revS,N):
    count = 0
    for i in range(N):
        revS.append(S[N-count-1])
        count += 1
    if S == revS:
        return 1
    else:
        return 0


for i in range(int((N-1)/2)):
    S2.append(S[i])
for i in range(int((N+3)/2)):
    S3.append(S[int((N+3)/2)-1])
if check(S,revS,N) == 1 and check(S2,revS2,len(S2)) == 1 and check(S3,revS3,len(S3)) == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input()
fi=''
la=''
a=0
b=0
n=len(s)
if(s[:]==s[::-1]):
    for i in range(0,((n-2)//2)+1):
        fi+=s[i]
#    print(fi)    
    for i in range((n+2)//2,n):
        la+=s[i]
#    print(la)    
    if(fi[:]==fi[::-1]):
        a=1
    if(la[:]==la[::-1]):
        b=1
    if(a==1 and b==1):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
def isPalindrome(s):
  n=len(s)
  i=0
  while(i<=(n-1)/2):
    if s[i]==s[-(i+1)]:
      i+=1
    else:
      return False
  return True

s=input()
n=len(s)

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

if isPalindrome(left) and isPalindrome(right):
  if isPalindrome(s):
    print("Yes")
  else:
    print("No")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
lst_S = list(S)

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
kai = []
kai2 = []
kai3 = []
rev = []
rev2 = []
rev3 = []

for i in range(N):
  kai.append(S[i])

for i in range(0, int((N - 1) / 2)):
  kai2.append(S[i])

for i in range(int((N + 3) / 2) - 1, N):
  kai3.append(S[i])

kai.reverse()
kai2.reverse()
kai3.reverse()

for i in range(N):
  rev.append(S[i])

for i in range(0, int((N - 1) / 2)):
  rev2.append(S[i])

for i in range(int((N + 3) / 2) - 1, N):
  rev3.append(S[i])

if kai == rev:
  if kai2 == rev2:
    if kai3 == rev3:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

Solution code:
import math

s = input()
n = len(s)
n2 = math.ceil(n/2)
result = 'Yes'

for i in range(n2):
    if s[i] != s[n-1-i]:
        result = 'No'

th = s[math.ceil(((n+3)/2)-1):n]
# print(th)
th_s = len(th)
th_n = math.ceil(th_s/2)
# print(th_s)
# print(th_n)

for i in range(th_n):
    if s[i] != s[th_s-1-i]:
        result = 'No'


print(result)

Submission status: Accepted

Solution code:
s=list(input())
import math
n=len(s)
app=s[0:(n-1)//2]
down=s[(n-1)//2+1:]
a=len(app)
d=len(down)
ans="No"
cnt=0
check1=0
check2=0
if n%4==3:
	for i in range((n-1)//2):
		if s[i]==s[n-1-i]:
			cnt+=1
	for j in range((d-1)//2):
		if down[j]==down[d-1-j]:
			check1+=1
	for k in range((a-1)//2):
		if down[k]==down[a-1-k]:
			check2+=1   
	if cnt==(n-1)//2 and check1==check2==(d-1)//2:
		ans="Yes"
if n%4==1:
	for i in range((n-1)//2):
		if s[i]==s[n-1-i]:
			cnt+=1
	for j in range(d//2):
		if down[j]==down[d-1-j]:
			check1+=1
	for k in range(a//2):
		if down[k]==down[a-1-k]:
			check2+=1   
	if cnt==math.ceil((n-1)/2) and check1==check2==math.ceil((d-1)/2):
		ans="Yes"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
N=len(S)
def f(ary):
    n=len(ary)
    h=n//2
    A,B=ary[:h],ary[h:]
    if n%2!=0:
        B=ary[h+1:]
    for a,b in zip(A,reversed(B)):
        if a!=b: 
            print('No')
            exit()
f(S)
Sl=S[:(N-1)//2]
Sr=S[(N+3)//2-1:]
f(Sl)
f(Sr)

print('Yes')

Submission status: Accepted

Solution code:
S = input()


def kai(text):
    if text == text[::-1]:
        return True
    else:
        return False


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

Submission status: Accepted

Solution code:
s = input()
hs = s[:int((len(s)-1)/2)]
def iskb(s):
    n = len(s)
    k = 1
    for i in range(int((n-1)/2)):
        if s[i] != s[-(i+1)]:
            k = 0
            break
    return k
def iskb2(s):
    n = len(s)
    k = 1
    for i in range(int(n/2)):
        if s[i] != s[-(i+1)]:
            k = 0
            break
    return k

if int((len(s)-1)/2)%2 == 0:
    if iskb(s)+iskb2(hs) == 2:
        print("Yes")
    else:
        print("No")
else:
    if iskb(s)+iskb(hs) == 2:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
def main():
    S = list(input())
    SR = list(reversed(S))
    if(S != SR):
        print("No")
        return 0
    s = S[0:(len(S)-1)//2]
    sr = list(reversed(s))
    if(s != sr):
        print("No")
        return 0
    print("Yes")

main()

Submission status: Accepted

Solution code:
from sys import stdin

S = stdin.readline().rstrip()
N = int(len(S))

S_reversed = "".join(list(reversed(S)))

S1 = S[0:int((N-1)/2)]
S1_reversed = "".join(list(reversed(S1)))


S2 = S[int((N+3)/2)-1:N]
S2_reversed = "".join(list(reversed(S2)))

answer = "Yes"

for i in range(N):
    if S[i] == S_reversed[i]:
        pass
    else:
        answer = "No"

for i in range(int((N-1)/2)):
    if S1[i] == S1_reversed[i]:
        pass
    else:
        answer = "No"

for i in range(int(N-(N+3)/2)):
    if S2[i] == S2_reversed[i]:
        pass
    else:
        answer = "No"

print(answer)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Mar 22 21:21:55 2020

@author: azikausy
"""


S = input()
N = len(S)
forw = S[:int((N-1)/2)]
back = S[int((N+3)/2)-1:]

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

Submission status: Accepted

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

S = input()
N = len(S)

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

flg = True
for i in range(int((half-1)/2)):
    if S[i] != S[half-1-i]:
        flg = False
        break
if flg == True and S[:half] == S[half+1:]:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

s=input()
list_s=list(s)
n=len(list_s)
m=int((n-1)/2)
if list_s[0:m] == list(reversed(list_s[m+1:])):
    if is_kaibun(s[0:m]):
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
bs = S[:N//2]
fs = S[N//2+1:]
#print(N//2, N,bs,fs)
if bs == fs:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

S = input()
S1 = ''
S2 = ''
if S == S[::-1]:
    S1 = S[0:(len(S) - 1) // 2]
    if S1 == S1[::-1]:
        S2 = S[(len(S) + 3) // 2 - 1:]
        if S2 == S2[::-1]:
            print('Yes')
            sys.exit()
print('No')

Submission status: Accepted

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

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


def check(s):
    #print(s)
    for i in range(len(s) // 2):
        c1 = s[i]
        c2 = s[-(i+1)]
        if c1 != c2:
            return False
    return True

main()

Submission status: Accepted

Solution code:
s = input()
n = len(s)
def judge(string):
    k = len(string)
    flag = True
    for i in range(k//2):
        if string[i] != string[-i-1]:
            flag = False
            break
    return flag
s1 = s[:(n-1)//2]
s2 = s[(n+3)//2-1:]
if judge(s) and judge(s1) and judge(s2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = list(input())
S_r = S[::-1]
N = len(S)
if S[:(N - 1)//2] == S_r[:(N - 1)//2]:
    T = S[:(N - 1)//2]
    T_r = T[::-1]
    if T == T_r:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
S=input()
n=len(S)
flag=0
S1=S[0:(n-1)//2]
S2=S[(n+2)//2:]
if S1==S1[::-1] and S2==S2[::-1] and S==S[::-1]:
    pass
else:
    flag=1
print('Yes' if flag==0 else 'No')

Submission status: Accepted

Solution code:
s = str(input())

num = int((len(s)-1) / 2)
num2 = int((len(s)+3) / 2)

f = s[:num]
b = s[num2-1:len(s)]

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

#print(S[0:a])
#print(''.join(list(reversed(S[0:a]))))
#print(S[b-1:])
#print(''.join(list(reversed(S[b-1:]))))

if S == ''.join(list(reversed(S))):
  if S[0:a] == ''.join(list(reversed(S[0:a]))):
    if S[b-1:] == ''.join(list(reversed(S[b-1:]))):
      print('Yes')
      exit()

print('No')

Submission status: Accepted

Solution code:
input_S = input()

S = list(input_S)
N = len(S)
ans = 0

for num in range(N):
    if S[num] != S[N - num - 1]:
        ans = 1

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
text_ = input()

if text_ != text_[::-1]:
    print('No')
elif text_[:((len(text_)-1) // 2)] != text_[:((len(text_)-1) // 2)][::-1]:
    print('No')
elif text_[((len(text_)+3)//2)-1:] != text_[((len(text_)+3)//2)-1:][::-1]:
    print('No')
else:
    print('Yes')

Submission status: Accepted

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

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

for i in range((n-1)//2):
    if s[i] != s[(n-3)//2-i]:
        judge = False

for i in range((n+1)//2,n):
    if s[i] != s[n-1+(n+1)//2-i]:
        judge = False

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

Submission status: Accepted

Solution code:
s = input()
s_len = len(s)
 
def judge(start=0, end=s_len):
  for i in range(start, end):
    if s[i] == s[end-1-i]:
      continue
    else:
      return 0
  return 1
 
if judge() and judge(end=(s_len-1)//2) and judge(start=(s_len+3)//2-1):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
S = list(S)
S_1 = S[0:int((len(S)-1)/2)]
S_2 = S[int((len(S)-1)/2)+1:len(S)]
S_2.reverse()

if S_1 == S_2:
    if len(S_1) % 2 == 0:
        S_1_1 = S_1[0:int((len(S_1)-1)/2)+1]
        S_1_2 = S_1[int((len(S_1)-1)/2)+1:len(S_1)]
        S_2_1 = S_2[0:int((len(S_2)-1)/2)+1]
        S_2_2 = S_2[int((len(S_2)-1)/2)+1:len(S_2)]
    else:
        S_1_1 = S_1[0:int((len(S_1)-1)/2)]
        S_1_2 = S_1[int((len(S_1)-1)/2)+1:len(S_1)]
        S_2_1 = S_2[0:int((len(S_2)-1)/2)]
        S_2_2 = S_2[int((len(S_2)-1)/2)+1:len(S_2)]
    S_1_2.reverse()
    S_2_2.reverse()
    if S_1_1 == S_1_2:
        if S_2_1 == S_2_2:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

s = input()
n = len(s)

kai1 = int((n - 1) / 2)
kai2 = int((n + 3) / 2)

first = s[0:kai1]
second = s[kai2-1:n]
if palindrome(s) == 0:
    if palindrome(first) == 0:
        if palindrome(second) == 0:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

Solution code:
def hantei(s):
    rev_s = s[::-1]

    for x in range(len(s)):
        if s[x] != rev_s[x]:
            return False
    
    return True

s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

N=len(S)
s0=list(S)

a=0
b=0
c=0

for i in range(N):
    if s0[i]==s0[N-1-i]:
        c=c+1

for i in range((N-1)//2):
    if s0[i]==s0[(N-1)//2-1-i]:
        a=a+1

for i in range((N+3)//2-1,N):
    if s0[i]==s0[N+(N+3)//2-i-2]:
        b=b+1

if a==b==(N-1)//2 and c==N:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s=input()
n=len(s)
k=0
s1=s[0:(n-1)//2+1]
s2=s[(n+3)//2-1:]
for i in range(len(s1)):
    if s1[i]==s[-i-1]:
        pass
    else:
        k=1
        break
for j in range(len(s2)):
    if s2[j]==s[-j-1]:
        pass
    else:
        k=1
        break
if k==1:
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

S = input()

if pal(S) and pal(S[0:int((len(S)-1)/2)]) and pal(S[int((len(S)+3)/2)-1:]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
S = list(map(str, input()))
cnt = 0

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
	S = input()
	S2 = S[:(len(S)-1)//2]
	S3 = S[(len(S)+3)//2-1:]
	if is_kaibun(S) and is_kaibun(S2) and is_kaibun(S3):
		print('Yes')
	else:
		print('No')

if __name__ == "__main__":
    main()