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()

def is_palindrome(t):
	# print("Checking", t)
	for i in range(len(t)//2):
		if t[i] != t[~i]:
			# print(t[i], "!=", t[~i])
			return False
	return True

n = 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()
k1 = ''
k2 = ''
for i in range(0,(len(S) - 1) // 2):
  k1 += S[i]
for j in range(((len(S) + 3) // 2) - 1, len(S)):
  k2 += S[j]
if k1 == k1[::-1] and k2 == k2[::-1] and 3 <= len(S) <= 99 and len(S) % 2 == 1 and S == S[::-1]:
  print('Yes')
else:
  print('No')
#print(k2)

Submission status: Accepted

Solution code:
s=input()

n=len(s)
flag=0
kaibun=0
l=[]

for i in range(int((n-1)/2)):
    if s[i] != s[n-1-i]:
        flag=1
    l.append(s[i])
    if flag ==1:
        break

if len(l)%2==0:
    for i in range(int(len(l)/2)):
        if l[i]!=l[len(l)-1-i]:
            kaibun=1
        if kaibun ==1:
            break
else:
    for i in range(int((len(l)-1)/2)):
        if l[i]!=l[len(l)-1-i]:
            kaibun=1
        if kaibun ==1:
            break  
if kaibun ==1 or flag==1:
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
import math


def isPalindrome(s):
    if s == s[::-1]:
        return True
    return False


def isStrongPalindrome(text):
    if isPalindrome(text):
        if isPalindrome(text[0:(len(text)-1)//2]):
            if isPalindrome(text[len(text)+3//2:]):
                return True
    return False


data = input()
    
if isStrongPalindrome(data):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
for i in range((n - 1)//4):
    if not(s[i] == s[(n-1)//2-i-1] and s[(n+3)//2 + i-1] ==  s[-i-1] and s[i] == s[-i-1]):
        print('No')
        exit()
if (n-1)%4 != 0:
    j = (n - 1) // 4
    if s[j] != s[-j-1]:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

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

def checkPalindrome(inStr):
    strLen = len(inStr)
    if strLen%2 == 1:
        loopMax = (strLen + 1) / 2
    else:
        loopMax = strLen / 2
    loopMax = int(loopMax)
    for index in range(loopMax):
        if(inStr[index] != inStr[strLen-1-index]):
            return False
    return True

if(not checkPalindrome(S)):
    print('No')
elif(not checkPalindrome(S[0:int((N-1)/2)])):
    print('No')
elif(not checkPalindrome(S[int((N+3)/2-1):N])):
    print('No')
else:
    print('Yes')

Submission status: Accepted

Solution code:
s = input()
count = 0

if s[:int((len(s)-1)/2)] == s[int((len(s)+1)/2):]:
    for j in range(len(s)):
        if s[j] == s[-(j+1)]:
            count += 1
    
    if count == len(s):
      	print('Yes')
    else:
      	print('No')
else:
    print('No')

Submission status: Accepted

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

    half_s = ['']*((len(s) - 1) // 2)
    for i in range((len(s) - 1) // 2):
        half_s[i] = s[i]
    rev_half_s = half_s[::-1]

    plus_three_s = [''] * (len(s) - ((len(s) + 3) // 2) + 1)
    count = 0
    for j in range(((len(s) + 3) // 2) - 1, len(s)):
        plus_three_s[count] = s[j]
        count += 1
    rev_plus_three_s = plus_three_s[::-1]

    if s == rev_s and half_s == rev_half_s and plus_three_s == rev_plus_three_s:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math

text = input()

def factrial(n):
    a = 0
    for i in range(1, n+1):
        a += i
    return a

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

r1 = (palindrome(text))
r2 = (palindrome(text[0:len(text) // 2]))
r3 = (palindrome(text[-(-len(text) // 2):]))
print('Yes' if r1 and r2 and r3 else 'No')

Submission status: Accepted

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

num = int(len(s) * 0.5 - 1.5)
index = int((n + 3) /2 -1 )
for i in range(num):
  if s[index+i] != s[n-1-i]:
    print("No")
    exit()
   
  
print("Yes")

Submission status: Accepted

Solution code:
S=(input())
 
N = len(S)
 
one = S[0:((N-1)//2)]
two = S[(N+3)//2-1:N]
 
def check_kai(text):
    left = len(text)//2
    
    for i in range(left):
 
        if text[i] != text[len(text)-1-i]:
            print('No')
            exit(0)
 
check_kai(S)
check_kai(one)
check_kai(two)
print('Yes')

Submission status: Accepted

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

if len(S1) % 2 == 0:
    S3 = S1[0:int((len(S1) - 1) / 2) + 1]
    S4 = S1[int((len(S1) + 3) / 2) - 1:]
    S4.reverse()
else:
    S3 = S1[0:int((len(S1) - 1) / 2)]
    S4 = S1[int((len(S1) + 3) / 2) - 1:]
    S4.reverse()

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

Submission status: Accepted

Solution code:
def judgeKaibun(list):
    for index, item in enumerate(list):
        if list[index] != list[(-1 * index) -1]:
            return "No"

    h = int((len(list)-1)/2)
    halflist = list[:h]
    for index, item in enumerate(halflist):
        if halflist[index] != halflist[(-1 * index) -1]:
            return "No"
    return "Yes"

s = list(input())
print(judgeKaibun(s))

Submission status: Accepted

Solution code:
S = input()
N = len(S)
flg = True
i = 0
while i <= (N-3)/2:
    if S[i]!=S[int((N-3)/2-i)]:
        flg = False
    i += 1
i = N-1
while i >= (N+1)/2:
    if S[i]!=S[int((3*N-1)/2-i)]:
        flg = False
    i -= 1
i = 0
while i <= N-1:
    if S[i]!=S[N-1-i]:
        flg = False
    i += 1
if flg:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
stra = input()


def hantei(s):
    for i in range(int(len(s) / 2)):
        if (s[i] != s[len(s) - 1 - i]):
            # print("A")
            return False
        if (int((len(s) + 3) / 2) - 1 + i < len(s) and s[(int((len(s) + 3) / 2)) - 1  + i] != s[len(s) - 1 - i]):
            # print("B")
            return False

    for i in range(int(len(s) / 4)):
        if (s[i] != s[int(len(s)/2) - 1 - i]):
            # print("C")
            return False
    return True


if(hantei(stra)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def palindrome(string): return 0 if string==string[::-1] else 1
stri = input()
s = list(stri)
a = len(s)//2
b = s[0:a]
c = s[a+1:]
d = palindrome(b)
e = palindrome(c)
f = palindrome(s)
if d==0 and e==0 and f==0:
    print('Yes')
else:
    print('No')

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()
N = len(S)

def check_kaibun(string):
    rev_string = string[::-1]
    check_len = int(len(string) / 2)
    i = 0
    while i <= check_len:
        if string[i] != rev_string[i]:
            return False
        i += 1
    return True

if all([check_kaibun(S[0:int((N -1) / 2)]), check_kaibun(S[int((N+3) / 2 -
    1):]), check_kaibun(S)]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input();h=len(s)//2;print(['No','Yes'][s[:h]==s[h-1::-1]==s[-h:]])

Submission status: Accepted

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

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

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

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

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

S = list(input())
N = int(len(S))
mae = (N-1)//2
usiro = (N+3)//2

S_m = S[0:mae]
S_u = S[usiro-1:]

if ispalindrome(S_m) and ispalindrome(S_u) and ispalindrome(S):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s=list(input())

n=len(s)
n1=(n-1)//2
n3=(n+3)//2
s1=s[:n1]
s3=s[n3-1:]
#print(s3)
s3.reverse()

if s1!=s3:
    print("No")
else :
    m=len(s1)
    if m%2==1:
        m1=(m-1)//2
        m3=(m+3)//2
        s11=s1[:m1]
        s33=s1[m3-1:]
        s33.reverse()
        if s11==s33:
            print("Yes")
        else:
            print("No")
    else:
        m1=(m)//2
        m3=m1+1
        s11=s1[:m1]
        s33=s1[m3-1:]
        s33.reverse()
        if s11==s33:
            print("Yes")
        else:
            print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/ python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = read().rstrip().decode()


def test(S):
    N = len(S)
    words = []
    words.append(S)
    words.append(S[: (N - 1) // 2])
    words.append(S[(N + 1) // 2:])
    return all(T == T[::-1] for T in words)


print('Yes' if test(S) else 'No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# sは奇数で確定
s = input()
list_s = list(s)

ans = 'No'

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

# 1. sが回文か
if is_kaibun(s) == True : 

    second_moji = ''
    aaa = (len(s) - 1) / 2
    aaa = int(aaa)

    for i in range(aaa): 
        second_moji = second_moji + list_s[i]

    # 2. (N−1)/2文字目まで回文か
    if is_kaibun(second_moji) == True :


        third_moji = ''
        bbb = (len(s) + 3) / 2
        bbb = int(bbb - 1)

        ccc = len(s) - bbb

        for i in range(ccc): 
            third_moji = third_moji + list_s[i + bbb]

            # 3. Sの (N+3)/2 文字目から N文字目まで(両端含む)からなる文字列は回文か
            if is_kaibun(third_moji) == True :
                ans = 'Yes'
        
print(ans)

Submission status: Accepted

Solution code:
S = list(input())

if ''.join(S[:len(S)//2]) != ''.join(S[len(S)//2 + 1:]):
    print("No")
    exit()

a = len(S) - 1// 2

if ''.join(S[:a//2]) != ''.join(S[a//2 + 1:]):
    print("No")
    exit()

b = len(S) + 3 // 2 - 1

if ''.join(S[:b//2]) != ''.join(S[b//2 + 1:]):
    print("No")
    exit()

print("Yes")

Submission status: Accepted

Solution code:
"""
"""


def int_as_array(num): return list(map(int, [y for y in str(num)]))


def array_as_int(arr): return int(''.join(map(str, arr)))


def read_int(): return int(input())


def read_array(): return list(map(int, input().split(' ')))


def array_to_string(arr, sep=' '): return sep.join(map(str, arr))


def matrix_to_string(arr, sep=' '): return '[\n' + '\n'.join(
    [sep.join(map(str, row)) for row in arr]) + '\n]'


def solve(string):
    if string != string[::-1]:
        return False
    first = string[0:(len(string) - 1) // 2]
    if first != first[::-1]:
        return False
    second = string[(len(string) + 2) // 2:]
    if second != second[::-1]:
        return False
    return True


string = input()
if solve(string):
    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[-i-1]:
        flag = "No" 
# print((N-1)//2)   

N2 = (N-1)//2
if N2 == 2:
    n = 1
else:
    n = N2
if flag == "Yes":
    for k in range(n):
        if S[k] != S[N2 -1 -k]:
            flag = "No"

if flag == "Yes":
    for k in range(n):
        if S[-k-1] != S[-(N2 -1 -k)-1]:
            flag = "No"

print(flag)

Submission status: Accepted

Solution code:
s = input()
if s == s[::-1]:
    flag = True
else:
    flag = False
N = len(s)
if flag:
    new = s[0:int((N-1)/2)]
    if new == new[::-1]:
        flag = True
    else: flag = False

if flag:
    new = s[int((N+2)/2):N]
    if new == new[::-1]:
        flag = True
    else:
        flag = False

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

Submission status: Accepted

Solution code:
s = input()

s_li = list(s)

rev_li = s_li[::-1]

n = len(s_li)
pre_n = (n - 1) // 2
sa_n = (n + 3) // 2 - 1

ans = True

if not s_li == rev_li:
    ans = False

if ans:
    pre_li = s_li[:pre_n]
    #print(pre_li)
    rev_pre_li = pre_li[::-1]
    if not pre_li == rev_pre_li:
        ans = False

if ans:
    sa_li = s_li[sa_n:]
    #print(sa_li)
    rev_sa_li = sa_li[::-1]
    if not sa_li == rev_sa_li:
        ans = False
        
if ans:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def is_par(s):
    l, r = 0, len(s) -1
    while l <= r:
        if s[l] != s[r]:
            return False
        l += 1
        r -= 1
    return True

S = input()
N = len(S)

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

Submission status: Accepted

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

def isKaibun(s, length):
    flag = True
    if length == 2:
        counter = 1
    else:
        counter = round((length-1)/2)
    for i in range(counter):
        # print(s[i], s[length - 1 - i])
        if s[i] != s[length-1-i]:
            flag = False
            break
    return flag



orta = int((n+1)/2)-1

if isKaibun(s, n) and isKaibun(s[:orta], orta) and isKaibun(s[orta+1:], orta):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def check(s):
    i, j = 0, len(s) - 1
    while i < j:
        if s[i] != s[j]:
            return False
        i += 1; j -= 1
    return True
s = input()
n = len(s)
n_S = s[0:(n - 1)//2]
n_E = s[(n+3)//2 - 1::]

if check(s) and check(n_S) and check(n_E):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

i = input()
l = len(i)
x = int((l-1)/2)
y = int((l+3)/2-1)
ii = i[0:x]
iii = i[y:l]

if (ispalindrome(i) == 1) and (ispalindrome(ii) == 1) and (ispalindrome(iii) == 1):
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

Submission status: Accepted

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

# 回文の判定
for i in range((n-1)//2):
  # print(i)
  if s[i] != s[n-i-1]:
    print('No')
    exit(0)
    
# 前半回文の判定
for j in range((n-1)//4):
  # print(j)
  if s[j] != s[(n-1)//2 -j-1]:
    print('No')
    exit(0)
    
# 回文の判定
for k in range((n+3)//2, n):
  # print(k)
  if s[k] != s[n-k-1]:
    print('No')
    exit(0)
    
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:
import sys
input = sys.stdin.readline

def main():
    S = input().strip()

    n = (len(S) + 1) // 2

    a = S[:n]
    b = S[n-1:]

    k = len(a[:-1])



    if k % 2 == 1:
        kn = k // 2
        aa = a[:-1][:kn]
        ab = a[:-1][kn+1:]

        ba = b[1:][:kn]
        bb = b[1:][kn+1:]
    else:
        kn = k // 2
        aa = a[:-1][:kn]
        ab = a[:-1][kn:]

        ba = b[1:][:kn]
        bb = b[1:][kn:]

    if a==b[::-1] and aa==ab[::-1] and ba==bb[::-1]:
        print('Yes')
    else:
        print('No')




if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    S = input()
    len_s = len(S)
    flag = False
    if S == S[::-1]:
        if S[0:len_s // 2] == S[len_s // 2 - 1::-1]:
            if S[len_s // 2 + 1:] == S[-1:len_s // 2:-1]:
                flag = True
    # print(S[0:len_s // 2], S[len_s // 2 - 1::-1])
    # print(S[len_s // 2 + 1:], S[-1:len_s // 2:-1])
    if flag:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = list(input())
S_rev = list(reversed(S))
N = len(S)
if S != S_rev:
  print('No')
else:
  S1 = S[:int((N-1)/2)]
  S2 = S[int((N+1)/2):]
  S1_rev = list(reversed(S1))
  S2_rev = list(reversed(S2))
  if S1==S1_rev and S2 == S2_rev:
    print('Yes')
  else:
    print('No')

Submission status: Accepted

Solution code:
S = input()

n = len(S)
ans = "No"
if S[:n//2] == S[n//2+1:][::-1]:
    S1 = S[:(n-1)//2]
    n1 = len(S1)
    if S1[:n1//2] == S1[(n1+1)//2:][::-1]:
        S2 = S[(n+3)//2-1:]
        n2 = len(S2)
        if S2[:n2//2] == S2[(n2+1)//2:][::-1]:
            ans = "Yes"

print(ans)

Submission status: Accepted

Solution code:
p=input()
a=len(p)
count=0
for i in range(((a-1)//2)-1):
	if p[i]!=p[a-i-1]:
		count += 1
for i in range(((a-1)//2)-1):
	if p[i]!=p[((a-1)//2)-1-i]:
		count += 1
for i in range(((a-1)//2)-1):
	if p[((a-1)//2)+1+i]!=p[a-1-i]:
		count += 1
if count==0:
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
import math
S=input()
N=len(S)
S1=S[0:math.floor((N-1)/2)]
S2=S[math.floor((N+3)/2)-1:N]
if S1==S1[::-1]:
  if S2==S2[::-1]:
    if S==S[::-1]:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Submission status: Accepted

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

if s != s[::-1]:
  print("No")
  exit()

key = int((n-1)/2)
tmp = s[0:key]
if tmp != tmp[::-1]:
  print("No")
  exit()

key = int(((n+3)/2)-1)
tmp = s[key:n]
if tmp != tmp[::-1]:
  print("No")
  exit()
  
print("Yes")

Submission status: Accepted

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

def string_parindrome(s):
    if parindrome(s):
        N = len(s)
        if parindrome(s[:((N-1)//2):]) and parindrome(s[((N+3)//2)-1::]):
            return "Yes"
    return "No"
    

S = input()
print(string_parindrome(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def isPalin(s):
    return s[::-1]==s
s=input()
n=len(s)
n1,n2=(n-1)//2,(n+3)//2
a,b=s[:n1],s[n2-1:]
#print(a,b)
if isPalin(a) and isPalin(b) and len(s)%2!=0 and isPalin(s):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import itertools#これは色々使える組み込み関数みたいなやつ
#import math#数学的計算はこれでいける。普通に0.5乗しても計算可能
#w=input()
from operator import itemgetter
from sys import stdin
#input = sys.stdin.readline#こっちの方が入力が早いが使える時に使っていこう

N=3
M=3
i=0
j=0
k=0

s=input()
a=[i for i in s]
#print(a)
N=len(s)
#print(N)
N1=int(((N-1)/2-1)/2+1)
N2=int((N-1)/2-1)
N3=int((N+3)/2-1)
N4=int((N+1)/2)
for i in range(N4):
    #print(i, N-1-i)
    if a[i]==a[N-1-i]:
        pass
    else:
        print("No")
        sys.exit()

for i in range(N1):
    if a[i]==a[N2-i] and a[N3+i]==a[N-1-i]:
        pass
    else:
        print("No")
        #print(a[i],a[N2-i])
        #print(a[N3+i],a[N-1-i])
        sys.exit()
print("Yes")
#N=int(input())
#A=int(input())
#B=int(input())
#print(N)
"1行1つの整数を入力を取得し、整数と取得する"


#number_list=list(map(int, input().split(" ")))#数字の時
#print(number_list)
"12 21 332 とか入力する時に使う"
"1行に複数の整数の入力を取得し、整数として扱う"

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
#メモ
for i in number_list:#こっちの方がrage使うより早いらしい
    print(number_list[i-1])

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

'''
x=[]
y=[]
for i in range(N):
    x1, y1=[int(i) for i in input().split()]
    x.append(x1)
    y.append(y1)
print(x)
print(y)
"複数行に2数値を入力する形式 x座標とy座標を入力するイメージ"
'''

'''
mixlist=[]
for i in range(N):
    a,b=input().split()
    mixlist.append((int(a),b))
print(mixlist)
"複数行にintとstrを複合して入力するやつ，今回はリスト一つで処理している"
'''

'''
#array=[input().split()for i in range(N)]
#print(type(array[0][0]))
#print(array)
"正方行列にstr型の値を入力"
'''

#brray=[list(map(int, input().split(" ")))for i in range(N)]
#print(type(brray[0][0]))
#print(brray)
'''
入力
1 2
4 5
7 8
出力結果
[[1, 2], [4, 5], [7, 8]]
'''
"列数に関して自由度の高いint型の値を入力するタイプの行列"
#以下に別解を記載
#N, M = [int(i) for i in input().split()]
'''
table = [[int(i) for i in input().split()] for m in range(m)]

print(type(N))
print(N)
print(type(M))
print(M)

print(type(table))
print(table)
'''




#s=input()
#a=[int(i) for i in s]
#print(a[0])
#print([a])
#単数値．桁ごとに分割したい．入力と出力は以下の通り
#イメージとして1桁ごとにリストに値を入れているかんじ

'''
入力
1234
出力
1
[[1, 2, 3, 4]]
'''




'''
word_list= input().split(" ")
print(word_list[0])
"連続文字列の入力"
"qw er ty とかの入力に使う"
"入力すると空白で区切ったところでlistの番号が与えられる"
'''



'''
A, B, C=stdin.readline().rstrip().split()#何個でもいけることが多い
print(A)
"リストではなく独立したstr型を入れるなら以下のやり方でOK"
'''


#a= stdin.readline().rstrip()
#print(a.upper())
"aという変数に入っているものを大文字にして出力"




#なんかうまく入力されるけど
#a=[[int(i) for i in 1.strip()]for 1 in sys.stdin]
#a = [[int(c) for c in l.strip()] for l in sys.stdin]]
#print(a)
#複数行の数値を入力して正方行列を作成

Submission status: Accepted

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

s = input()
n = len(s)

s1 = s[::-1]
# print(s1)
# print(is_kaibun(s))

# S  は回文である。
# N を S の長さとするとき、S の 1 文字目から (N−1)/2 文字目まで(両端含む)からなる文字列は回文である。
a = int((n - 1) / 2 - 1)
# print(a)
s2 = s[0:a + 1]
# print(s2)
# print(is_kaibun(s2))

# S の (N+3)/2 文字目から N 文字目まで(両端含む)からなる文字列は回文である。
b = int((n + 3) / 2 - 1)
s3 = s[b:]
# print(s3)
# print(is_kaibun(s3))

if is_kaibun(s) and is_kaibun(s2) and is_kaibun(s3):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

r = 0

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

s_1 = s[:int(a)]
s_2 = s[int(b-1):]


def cond(l=None):
    if l is None:
        l = []
    
    l_rev = list(reversed(l))
    if l == l_rev:
        return 0
    else:
        return 1


for l in (s, s_1, s_2):
    r = cond(l)
    
    if r != 0:
        break

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

Submission status: Accepted

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

import math
M = math.floor((N-3)/2)

a = 0

for i in range(M):
  if S[i] != S[i+M+2]:
    a = 1
    
for j in range(M):
  if S[j] != S[N-j-1]:
    a = 1
    
if a == 0:
  print('Yes')
  
else:
  print('No')

Submission status: Accepted

Solution code:
s=str(input())
def judge(s):
  l=len(s)
  if l%2==1:
    for i in range((l-1)//2):
      if s[i]==s[-i-1]:
        pass
      else:
        return 0
    return 1
  else:
    for i in range(l//2):
      if s[i]==s[-i-1]:
        pass
      else:
        return 0
    return 1
L=len(s)
if judge(s)==1 and judge(s[0:(L-1)//2])==1 and judge(s[(L+3)//2-1:])==1:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = str(input())
judge = 'Yes'
S = list(S)
for i in range(int(len(S)/2)):
    if S[i] != S[len(S) - 1 - i]:
        judge = 'No'
for i in range(int(len(S)/4)):
    if S[i] != S[int(len(S)/2) - 1 - i]:
        judge = 'No'
for i in range(int(len(S)/4)):
    if S[i + int(len(S)/2) + 1] != S[int(len(S)) - 1 - i]:
        judge = 'No'
print(judge)

Submission status: Accepted

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

s = input()
if(palindrome(s)):
    n = len(s)
    if(palindrome(''.join(list(s)[:((n-1)//2)]))):
        if(palindrome(''.join(list(s)[((n+3)//2)-1:n]))):
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
T = ''.join(list(reversed(S)))
N = len(S)
T1 = "".join(list(reversed(S[:int((N-1)/2)])))
T2 = ''.join( list( reversed( S[int((N+3)/2)-1:] ) ) )

Ans = "Yes"

if S != T or S[:int((N-1)/2)] != T1 or S[int((N+3)/2)-1:] != T2:
    Ans = "No"

print(Ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
  s = input()
  hoge = len(s) // 2
  bit = 0
  if s[0:hoge] == s[-hoge:len(s)][::-1]:
    bit += 1
  n = hoge
  if s[0:hoge][0:hoge] == s[0:hoge][-hoge:len(s)][::-1]:
    bit += 1
  hoge = (len(s) + 3) // 2 - 1
  ss = s[hoge:len(s)]
  huga = len(ss) // 2
  if ss[0:huga] == ss[-huga:len(ss)][::-1]:
    bit += 1
  if len(s) == 3:
    bit = 3
  if bit == 3:
    print("Yes")
  else:
    print("No")
  return 0

if __name__ == "__main__":
  solve()

Submission status: Accepted

Solution code:
s = input()

def judge(s):
    n = len(s)
    for i in range(n//2):
        if s[i] == s[n-1-i]:
            continue
        else: return 0
    return 1

temp1 = s[:len(s)//2]
temp2 = s[len(s)//2+1:]

if judge(s) and judge(temp1) and judge(temp2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

S = list(input())

N = len(S)

#N-1/2

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


#N+3/2
S2 = S[int((N+3)/2)-1:]

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

Submission status: Accepted

Solution code:
line=input()
n=int(len(line))
m=int((n-1)/2)
front_line=line[:m]
if line != line[::-1]:
  print("No")
else:
  if front_line != front_line[::-1]:
    print("No")
  else:
    print("Yes")

Submission status: Accepted

Solution code:
def kaibun(s):
    N = len(s)

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

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

Submission status: Accepted

Solution code:
s = input()

s = [c for c in s]

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

def check(s):
    left = []
    right = []
    while len(s)>1:
        left.append(s.pop(0))
        right.append(s.pop())

    if left==right:
        return True
    else:
        return False


if check(left)==True and check(right)==True and check(s)==True:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
count = 0
halfn = int((n-1) / 2)
whalfn = int((n-1) / 4)
half = s[0:halfn]

for i in range(len(s)):
    if s[i] != s[-i-1]:
      count += 1
      break
    else:
      pass

for i in range(len(half)):
  if half[i] != half[-i-1]:
    count += 1
    break
  else:
    pass

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

Submission status: Accepted

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


def palindromic(word):
    if word == word[::-1]:
        return 1
    else:
        return 0


flag = palindromic(S)
flag2 = palindromic(S[0:(N - 1) // 2])
flag3 = palindromic(S[(N + 2) // 2:])
if(flag3 == 1 and flag == 1 and flag2 == 1):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

s_ = s[:len(s)//2]
_s = s[1+len(s)//2:]

if s_ != _s:
  print('No')
  quit()


if (len(s)//2)%2==0:
  a = s_[:len(s_)//2]
  b = s_[len(s_)//2:][::-1]
  c = _s[:len(_s)//2]
  d = _s[len(_s)//2:][::-1]
  # print(a,b,c,d)
  if a == b:
    if c == d:
      print('Yes')
      quit()

  print('No')

if (len(s)//2)%2==1:
  a = s_[:len(s_)//2]
  b = s_[1+len(s_)//2:][::-1]
  c = _s[:len(_s)//2]
  d = _s[1+len(_s)//2:][::-1]
  # print(a,b,c,d)
  if a == b:
    if c == d:
      print('Yes')
      quit()

  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
f=True
for i in range(N//2):
    if S[i]!=S[-1-i]:f=False
if f==True:
    s1=S[0:(N-1)//2]
    s2=S[(N+3)//2-1::]
    for i in range(N//2//2):
        if s1[i]!=s1[-1-i] or s2[i]!=s2[-1-i]:f=False
print("Yes") if f==True  else print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
flag = True
for i in range(N//2):
    if S[i]!=S[N-1-i]:
        flag = False
moji1 = S[:((N-1)//2)]
for i in range(N//2):
    if moji1[i]!=moji1[len(moji1)-1-i]:
        flag = False
moji = S[((N+3)//2)-1:]
for i in range(N//2):
    if moji[i]!=moji[len(moji)-1-i]:
        flag = False

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