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

Solution (Python):
import math
import sys

s = input()
n= len(s)


"""
sが回文かどうかのチェック
"""
end = n
for i in range(end):
  head = s[i]
  tail = s[end-i-1]
  if head != tail:
    print('No')
    sys.exit()
    
"""
2つめチェック
"""
end = int((n-1)/2)
for i in range(end):
  head = s[i]
  tail = s[end-i-1]
  if head != tail:
    print('No')
    sys.exit()

"""
3つめチェック
"""
start=int((n+3)/2)-1
end = n
iteration=0
for i in range(start,end):
  head = s[i]
  tail = s[end-iteration-1]
  iteration+=1
  if head != tail:
    print('No')
    sys.exit()

print('Yes')

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

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

if not palindrome(S):
  print('No')
  exit(0)

left = S[0:int((N-1)//2)]
right = S[int((N+3)//2)-1:N]

if not palindrome(left):
  print('No')
  exit(0)
if not palindrome(right):
  print('No')
  exit(0)

print('Yes')

Solution (Python):

import sys,math
s = list(input())

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

for i in range(n):
    
    if s[i] != s[n - 1 - i]:
        print('No')
        sys.exit()
start = math.ceil((len(s) + 3) / 2)-1

for i in range(start, len(s)):
    
    if s[i] != s[n - i]:
        print('No')
        sys.exit()
print('Yes')

Solution (Python):

if True:
    s = input()


else:
    s="attaiatta"


def isKaibun(data):
    zen = data[0:int(len(data)/2)]
    go=""
    if len(data)%2 == 1:
        range_from = int(len(data)/2)+1
    else:
        range_from = int(len(data)/2)

    for i in range(range_from,len(data)):
        go = data[i:i+1] + go
    
    
    return (zen == go)

n=len(s)

isKaibun(s)
before = s[0:int((n-1)/2)]
after = s[int((n+3)/2)-1:n]


if isKaibun(s) and isKaibun(before) and isKaibun(after):
    print("Yes")
else:
    print("No")

Solution (Python):

import sys
s = input()
for i in range(len(s)//2):
    if s[i] != s[-1-i]:
        print("No")
        sys.exit()
s2 = s[:(len(s)-1)//2]
for i in range((len(s)-1)//2):
    if s2[i] != s2[-1-i]:
        print("No")
        sys.exit()
s3 = s[(len(s)+3)//2-1:]
for i in range((len(s)-1)//2):
    if s3[i] != s3[-1-i]:
        print("No")
        sys.exit()
print("Yes")

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

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

m = len(head_1)

if str(head_1) != str(tail_1):
    print('No')
else:
    head_2 = head_1[:m // 2]
    tail_2 = head_1[m:(m - 1) // 2:-1]

    if str(head_2) == str(tail_2):
        print('Yes')
    else:
        print('No')

Solution (Python):
s = list(input())
n = len(s)
sign = 0
limit_1 = int((n-1)//2)

judge = limit_1%2
if judge == 0:
  limit_2 = int(limit_1//2)
elif judge == 1:
  limit_2 = int((limit_1+1)//2)

for i in range(limit_2):
  if not (s[i] == s[i-limit_1]):
    sign = 1

if s[:limit_1] != s[limit_1+1:] :
  sign = 1

if sign == 0:
  ans = "Yes"
elif sign == 1:
  ans = "No"
  
print(ans)

Solution (Python):
def pal(p):
    pp = p
    r = True
    for i in range(len(p)):
        if p[i] != pp[-i-1]:
            r = False
            break
    return r

s = input()
n = len(s)
r = 'No'
if pal(s) and pal(s[0:int((n - 1) / 2)]) and pal(s[int((n + 2) / 2):n]):
    r = 'Yes'
print(r)

Solution (Python):
s = input()

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

nagasa = (int(len(s)) - 1) // 2
nagasa2 = (int(len(s)) +3 ) // 2
nagasa3 = int(len(s))

result = ispalindrome(s) 

tmp = s[0:nagasa]
result = result + ispalindrome(tmp)

tmp2 = s[nagasa2-1:nagasa3]
result = result + ispalindrome(tmp2)

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

Solution (Python):

def PalindromeCheck(str_s):
    result = "Yes"
    for i in range((len(str_s) // 2)):
        
        if str_s[i] != str_s[len(str_s) -1 - i]:
            result = "No"
            break
    return result

def StrongCheck(str_s):
    result = "Yes"
    if PalindromeCheck(str_s) == "No":
        result = "No"
    if PalindromeCheck(str_s[0:(len(str_s) -1) // 2]) == "No":
        result = "No"
    if PalindromeCheck(str_s[(len(str_s) + 3) // 2:len(str_s) - 1]) == "No":
        result = "No"
    return result


str_s = input()
print(StrongCheck(str_s))

Solution (Python):
def kaibunChk(txt):
    txtLen = len(txt)
    for si in range(txtLen):
        if txt[si] != txt[txtLen - si - 1]:
            print("No")
            exit()


s = input()
slen = len(s)
clen = slen // 2

kaibunChk(s)
kaibunChk(s[:clen])
kaibunChk(s[clen + 1:])

print("Yes")

Solution (Python):
s = input()

def check(ss):
    idx = 1
    nn = (len(ss)-1)//2
    if len(ss) == 1:
        return True
    elif len(ss) == 2:
        if ss[0]==ss[1]:
            return True
        else:
            return False
    for i in range(nn):
        
        if ss[i] != ss[-i-1]:
            return False
    return True
    

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

print('No')

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

c = (len(s)-1) // 2

l = s[:c]
r = s[-c::][::-1]

ss = s[(n+3)//2-1:]
nn = len(ss)
cc = (nn-1) // 2
ll = ss[:cc]
rr = ss[-cc::][::-1]

if n == 3:
    if s[0] == s[-1]:
        print('Yes')
    else:
        print('No')
elif l == r and ll == rr:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
readline = sys.stdin.buffer.readline

s = readline().rstrip().decode('utf-8')

n = len(s)

def judge(k):
    l = len(k)
    if l%2==0:
        a = k[:l//2]
        b = k[l//2:]
        b = b[::-1]
        if a==b:
            return True
        else:
            return False
    else:
        a = k[:l//2]
        b = k[l//2+1:]
        b = b[::-1]
        if a==b:
            return True
        else:
            return False
if judge(s) and judge(s[:(n-1)//2]) and judge(s[(n+3)//2-1:]):
    print("Yes")
else:
    print("No")

Solution (Python):
S = input()

kaibun = True
N = len(S)

if not S[:] == S[::-1]:
    kaibun = False
if not S[:(N-1)//2:] == S[(N-1)//2-1::-1]:
    kaibun = False
if not S[(N+3)//2-1:] == S[:(N+3)//2-2:-1]:
    kaibun = False

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

Solution (Python):
S=str(input())

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

if S!=S[::-1]:
    f=0
if s1!=s1[::-1]:
    f=0
if s2!=s2[::-1]:
    f=0

if f==1:
    print("Yes")
else:
    print("No")

Solution (Python):
def kaibun(s):
    flg = False
    if len(s) % 2 == 0:
        if s[0:int((len(s)/2))] == s[int(len(s)/2):len(s)][::-1]:
            flg =True
    else:
        
        if s[0:int((len(s)-1)/2)] == s[int((len(s)+1)/2):len(s)][::-1]:
            flg =  True
    return flg



s = input()
ans = "No"



if kaibun(s):
    if kaibun(s[0:int((len(s)-1)/2)]) and kaibun(s[int((len(s)+1)/2):len(s)]):
        ans = "Yes"
print(ans)

Solution (Python):
s = (input())

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

if n == 3:
    if s[0] == s[-1]:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
        
flag1 = True
for i in range(len(s1)//2):
    if s1[i] == s1[-i-1]:
        flag1 = True
    else:
        flag1 = False
        break

if flag1 and (s1 == s2):
    print("Yes")
else:
    print("No")

Solution (Python):

def main():
    s = input()
    n = len(s)
    result = "No"
    if s == s[::-1]:
        m = (n - 1) // 2
        if s[:m] == s[:m][::-1]:
            l = (n + 3) // 2
            if s[l - 1:] == s[l - 1:][::-1]:
                result = "Yes"
    print(result)

if __name__ == '__main__':
    main()

Solution (Python):
s = input()
s_inv = s[::-1]
n = int(len(s))
start = (n-1)/2
fin = (n+2)/2


if s == s_inv:
  s1 = s[:int(start)]
  s1_inv = s1[::-1]
  if s1 == s1_inv:
    s2 = s[int(fin):]
    s2_inv = s2[::-1]
    if s2 == s2_inv:
      print("Yes")
    else:
      print("No")
  else:
    print("No")
else:
  print("No")

Solution (Python):
s = input()

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

Solution (Python):
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')

Solution (Python):
s = input()
n = len(s)
s_r = s[::-1]
s1 = s[0:int((n-1)/2)]
s1_r = s1[::-1]
s2 = s[int((n+3)/2)-1:]
s2_r = s2[::-1]
isok = 'No'
if s==s_r:
    if s1==s1_r:
        if s2==s2_r:
            isok='Yes'
print(isok)

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

left_edge = int((n - 1) / 2)
right_edge = int((n + 1) / 2)

left = s[:left_edge]
right = s[right_edge:]

def is_kaibun(sentence):
    s_n = len(sentence)
    if s_n % 2 == 0:
        left_edge = right_edge = int(s_n / 2)
    else:
        left_edge = int((s_n - 1) / 2)
        right_edge = int((s_n + 1) / 2)
    left = sentence[:left_edge]
    right = sentence[right_edge:]
    right_rev = right[::-1]
    for l, r in zip(left, right_rev):
        if not l == r:
            return False
    else:
        return True

whole_kaibun = is_kaibun(s)
left_kaibun = is_kaibun(left)
right_kaibun = is_kaibun(right)
if all([whole_kaibun, left_kaibun, right_kaibun]):
    print('Yes')
else:
    print('No')

Solution (Python):
def c1(S):
    N=len(S)
    if S == S[::-1]:
        return True
    else:
        return False

S=input()
N=len(S)
SS=S[:(N-1)//2]
SSS=S[(N+3)//2-1:]
if SS==SSS and c1(SS):
    print("Yes")
else:
    print("No")

Solution (Python):
from sys import stdin

s = str(stdin.readline().rstrip())
len_s = len(s)

half_a = s[0:int((len_s - 1)/2)]
rev_half_a = half_a[::-1]
half_b = s[:int((len_s - 1)/2):-1]
rev_half_b = half_b[::-1]

if half_a == half_b:
    if rev_half_a == half_a:
        if rev_half_b == half_b:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Solution (Python):
s = input()
n = len(s)
l = s[:(n-1)//2]
r = s[(n-1)//2+1:]

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

Solution (Python):
S=str(input())

N=int(len(S))

count = 0
counta=0
for i in range((N-1)//2):
    if S[i]==S[(N-1)//2-i-1]:
        count+=0
    else:
        count+=1

for i in range((N-1)//2):
    if S[i+(N+1)//2]==S[N-1-i]:
        count+=0
    else:
        count+=1
for i in range(N):
    if S[i]==S[N-1-i]:
        count+=0
    else:
        count+=1

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

Solution (Python):
import sys

s = input()
left = s[: len(s) // 2]
right = s[len(s) // 2 + 1 :]
if left != right[::-1]:
    print("No")
    sys.exit()
for i in range(len(left) // 2):
    if left[i] != left[-i - 1]:
        print("No")
        sys.exit()
print("Yes")

Solution (Python):
def pallindrome(s):
  x = len(s)
  flag = 0
  for i in range(x//2):
    if s[i] != s[x-1-i]:
      flag = 1
      break
  return flag
s = input()
n = len(s)
newS = pallindrome(s)
a = pallindrome(s[:((n-1)//2)])
b = pallindrome(s[((n+2)//2):])
if newS == 0 and a == 0 and b == 0:
  print("Yes")
else:
  print("No")

Solution (Python):
s=input()
s_len = len(s)

if s == s[::-1]:
    s1 = s[0:(s_len-1)//2]
    if s1 == s1[::-1]:
        s2 = s[(s_len+3)//2-1:]
        if s2 == s2[::-1]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Solution (Python):
s=input()
n=len(s)
m=s[0:(n-1)//2]
p=s[(n+3)//2-1:]
if s!=s[::-1]:
    print("No")
    quit()
elif m!=m[::-1]:
    print("No")
    quit()
elif p!=p[::-1]:
    print("No")
    quit()
print("Yes")

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  

def is_kaibun(s):
    
    rev_s = ''.join(list(reversed(s)))
    
    return s == rev_s

def solve(S: str):
    if not is_kaibun(S):
        print(NO)
        return
    N = len(S)
    if N % 2 == 0:
        print(NO)
        return
    if not is_kaibun(S[0:(N-1)//2]):
        print(NO)
        return
    if not is_kaibun(S[(N+3)//2-1:]):
        print(NO)
        return

    print(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)  
    solve(S)

if __name__ == '__main__':
    main()

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


def f(s):
    n = len(s)
    if n % 2 == 0:
        return list(s[:n // 2]) == list(reversed(s[n // 2:]))
    else:
        return list(s[:n // 2]) == list(reversed(s[n // 2 + 1:]))


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

Solution (Python):
s = input()

is_palindrome = s == s[::-1]

first_sub_string = s[:int((len(s)-1)/2)]
first_is_palindrome = first_sub_string == first_sub_string[::-1]

second_sub_string = s[int((len(s)+3)/2)-1:]
second_is_palindrome = second_sub_string == second_sub_string[::-1]

if all([is_palindrome, first_is_palindrome, second_is_palindrome]):
    print("Yes")
else:
    print("No")

Solution (Python):
moji = input()
n=len(moji)
mae=moji[0:(n-1)//2]
ato=moji[(n+3)//2-1:n]
moji0 = moji[::-1]
mae0 = mae[::-1]
ato0 = ato[::-1]
if ((moji == moji0) and (mae == mae0) and (ato == ato0)):
  print('Yes')
else:
  print('No')

Solution (Python):
def is_kaibun(s):
    half = int(len(s) / 2) if len(s) % 2 == 0 else int((len(s) + 1) / 2)
    for i in range(half):
        if s[i] != s[-(i + 1)]:
            return False
    return True


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

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

Solution (Python):
def palindrom(st):
    return st == st[::-1]
import math
s = input()
l = len(s)
print("Yes" if palindrom(s) and palindrom(s[:(l-1)//2]) and palindrom(s[(l+2)//2:]) else "No")

Solution (Python):
s = input()
s_return = s[::-1]
x = (len(s) - 1)// 2
s_1_x = s[:x]
s_1_x_return = s_1_x[::-1]
y = (len(s) + 3)//2
s_1_y = s[y - 1:len(s)]
s_1_y_return = s_1_y[::-1]

if s == s_return:
    if s_1_x == s_1_x_return and s_1_y == s_1_y_return:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Solution (Python):
s=input()
a=list(s)
n=len(a)
m=(n-1)//2
t='Yes'
for c in range(m):
    if a[c]!=a[m-1-c] or a[m+1+c]!=a[n-1-c] or a[c]!=a[m+1+c]:
        t='No'
        break
print(t)

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

def kai(s):
  n = len(s)
  ok = True
  if n % 2 == 0:
    a = 0
  else:
    a = 1
  for i in range(int((n-a)/2)):
    if s[i] != s[-(i+1)]:
      ok = False
  return ok

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

Solution (Python):
import copy
S = input()
N = len(S)

def is_kaibun(kaibun):
    for i in range(len(kaibun)//2):
        if kaibun[i] != kaibun[-i-1]:
            return False
    return True
      
if is_kaibun(S) and is_kaibun(S[:((N-1)//2)]) and is_kaibun(S[((N+2)//2):]):
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()

ans = True

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

firstS = s[0:len(s)//2]
secondS = s[len(s)//2+1:len(s)]



for i in range(len(firstS)) :
    if firstS[i] != firstS[len(firstS)-1-i] :
        ans = False



for i in range(len(secondS)) :
    if secondS[i] != secondS[len(secondS)-1-i] :
        ans = False
    
    if firstS[i] != secondS[i] :
        ans = False

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

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

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



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

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

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

def abc(a):
    S1 = a[:(N-1)//2]
    r_S1 = S1[::-1]
    S2 = S[(N-1)//2+1:len(S)]
    return r_S1 == S2

if __name__ == '__main__':
    if abc(S) and abc(S[:(N-1)//2]) and abc(S[(N-1)//2+1:len(S)]):
        print('Yes')
    else:
        print('No')

Solution (Python):

from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def main():
    s = input().strip()
    t = s[:len(s) // 2]
    result = s == s[::-1] and t == t[::-1]
    print("Yes" if result else "No")




BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")



if __name__ == "__main__":
    main()

Solution (Python):
s = input()

n = len(s)

s_l = s[:int((n-1)/2)]
s_r = s[int((n-1)/2)+1:]

c = 0

if ''.join(reversed(s_l)) == s_l:
    c += 1
if ''.join(reversed(s_r)) == s_r:
    c += 1
if s_l == ''.join(reversed(s_r)):
    c += 1

if c== 3:
    print('Yes')

else:
    print('No')

Solution (Python):
data = input()
S = [c for c in data]
S_inverse = list(reversed(S))

N = len(S)

if S != S_inverse:
    print("No")
    exit(0)

if S[: int((N - 1) / 2)] != S_inverse[int((N + 3) / 2 - 1):]:
    print("No")
    exit(0)

if S[int((N + 3) / 2 - 1):] != S_inverse[:int((N - 1) / 2)]:
    print("No")
    exit(0)

print("Yes")

Solution (Python):
s = input()

def isKaibun(s):
    l = int(len(s)/2)
    
    f = True
    
    for i in range(l):
        
        if s[i] != s[-(i+1)]: f = False
    return f
    
def isStrongKaibun(s):
    
    if len(s)==1:
        return True
    else:
        if isKaibun(s):
            return isKaibun(s[0:int(len(s)/2)])
        else:
            return False

print("Yes" if isStrongKaibun(s) else "No")

Solution (Python):
s = input()
s_len = len(s)
s_reversed = s[::-1]
s_before = s[0:(s_len - 1) // 2:]
s_before_reversed = s_before[::-1]
s_after = s[((s_len + 3) // 2 - 1) : s_len:]
s_after_reversed = s_after[::-1]
if s == s_reversed and s_before == s_before_reversed and s_after == s_after_reversed:
  print("Yes")
else:
  print("No")

Solution (Python):
s = (str(input()))
s1 = str(s[len(s)//2+1:])

s2 = str(s[:len(s)//2])

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

Solution (Python):
S = input()
N = len(S) // 2

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

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

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

Solution (Python):
S = input()
S1 = S[0:int((len(S)-1)/2)]
S2 = S[int((len(S)+1)/2):len(S)]
L = []
for i in range(int((len(S)-1) / 2)):
    if S[i] != S[-i-1]:
        L.append('No')
        break
    else:
        L.append('Yes')
for j in range(round((len(S1)-1) / 2)):
    if S1[j] != S1[-j-1]:
        L.append('No')
        break
    else:
        L.append('Yes')
for k in range(round((len(S2)+1) / 2)):
    if S2[k] != S2[-k-1]:
        L.append('No')
        break
    else:
        L.append('Yes')
if set(L) == {'Yes'}:
    print('Yes')
else:
    print('No')

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

Solution (Python):
import math
l = list(input())
N = len(l)
for i in range(math.floor((N+1)/4)):
  if l[i] == l[N- 1 - i] and l[i] == l[int((N-3)/2 - i)] and l[int((N-3)/2 - i)] == l[int((N+1)/2 + i)]:
    continue
  else:
    print('No')
    exit()
print('Yes')

Solution (Python):
def resolve():
    s = input()
    rs = s[::-1]
    if rs != s:
        print("No")
        exit()
    
    if len(s) == 3:
        print("Yes")
        exit()
    s1 = s[:((len(s)-1)//2)]
    s2 = s[((len(s)+3)//2)-1:]
    rs1 = s1[::-1]
    rs2 =s2[::-1]
    if s1 == rs1 and s2 == rs2:
        print("Yes")
    else:
        print("No")
resolve()

Solution (Python):


def main():
    s = input()
    
    n = len(s)
    m = (n-1)//2
    o = (n+3)//2
    p = s[:m]
    q = s[o-1:]

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

if __name__ == '__main__':
    main()

Solution (Python):
s=list(input())
n=len(s)
for i in range((n-1)//2):
    if s[i]==s[((n-1)//2)-1-i] and s[i]==s[n-1-i]:
        continue
    else:
        print('No')
        break
else: print('Yes')

Solution (Python):
s=list(input())

length1 = int((len(s)-1)/2-1)
length2 = int((len(s)+3)/2-1)

if s == list(reversed(s)) and s[:length1+1] == list(reversed(s[:length1+1])) and s[length2:] == list(reversed(s[length2:])):
    print('Yes')
else:
    print('No')

Solution (Python):
import math
x=input()
N=len(x)
flag=True
for i in range(math.floor(N/2)):
    if x[i]!=x[-(i+1)]:
        flag=False
        break
        
for i in range(math.floor(N/4)):
    if x[i]!=x[(math.floor((N-1)/2)-i-1)]:
        flag=False
        break
    if x[math.floor((N+3)/2)+i-1]!=x[(N-i)-1]:
        flag=False
        break
if flag==True:
    print('Yes')
else:
    print('No')

Solution (Python):
def checkPalindrome(str1, str2):
  for i in range(len(str1) // 2):
    if str1[i] != str2[i]:
      return False
  return True
    
s = input()
rs = ''.join(list(reversed(s)))
cri1 = checkPalindrome(s, rs)

s2 = s[:len(s) // 2]
rs2 = ''.join(list(reversed(s2)))
cri2 = checkPalindrome(s2, rs2)

s3 = s[len(s) // 2 + 1:len(s)]
rs3 = ''.join(list(reversed(s3)))
cri3 = checkPalindrome(s3, rs3)

if cri1 and cri2 and cri3:
  print('Yes')
else:
  print('No')

Solution (Python):


s = input()

length_left =len(s)//2

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

Solution (Python):
import bisect, collections
 
 
 
def solution():
    s = input().strip()
    if s == s[::-1] and s[:(len(s)-1)//2] == s[:(len(s)-1)//2][::-1]:
        print("Yes")
    else:
        print("No")
                

def main():    
    
    for _ in range(1):
        solution()

if __name__ == "__main__":
    main()

Solution (Python):
s = input()

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

for i in range(len(s)//2):
    if s[i] != usiro[i]:
        print("No")
        exit()

print("Yes")

Solution (Python):

import sys

YES = "Yes"  
NO = "No"  


def solve(S: str):
    def pe(string): return string.find(string[::-1])
    if pe(S)==-1:
        print(NO)
    else:
        o=S[:int(((len(S)-1)/2))]
        if pe(o)==-1:
            print(NO)
        else:
            u=S[int((len(S)+3)/2)-1:len(S)]
            if pe(u)==-1:
                print(NO)
            else:
                print(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)  
    solve(S)

if __name__ == '__main__':
    main()

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

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

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

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

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

print('Yes')

Solution (Python):
S = input()
left = S[:int((len(S) - 1) / 2)]
right = S[int((len(S) + 1) / 2):]

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

Solution (Python):
dat = input()

n=len(dat)

def judge(s):
    ret = True
    for i in range(int(len(s)/2)):
        if s[i] != s[-i-1]:
            ret = False
    return ret
pre = dat[:int((n-1)/2)]
pos = dat[int((n+3)/2 - 1):]

if judge(dat) and judge(pre) and judge(pos):
    print("Yes")
else:
    print("No")

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

s_r = list(reversed(s))


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


if s == s_r:
    x = s[:a]
    y = s[b:]

    if x == list(reversed(x)) and y == list(reversed(y)):
        print('Yes')
        exit()
print('No')

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

def isPalindrome(S, i, j):
    i = int(i)
    j = int(j)
    while S[i] == S[j]:
        i+=1
        j-=1
        if i >= j:
            return True
    return False

if isPalindrome(S, 0, N-1) and isPalindrome(S, 0, (N-1)/2-1) and isPalindrome(S, (N+3)/2-1, N-1):
    print('Yes')
else:
    print('No')

Solution (Python):
S = list(input())
N = len(S)
M = (N-1)//2
S1 = S[:(N-1)//2]
S2 = S[(N+1)//2:]
S2.reverse()
S11 = S1[:M//2]
S12 = S1[M//2 + M%2:]
S12.reverse()

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

Solution (Python):
s=input()
n=len(s)
a=s[((n+3)//2)-1:n]
ans="No"
if s==s[::-1]:
    if s[:(n-1)//2]==s[:((n-1)//2):-1]:
        if a==a[::-1]:
            ans="Yes"
print(ans)

Solution (Python):

def kaibun(bun):
    n=len(bun)
    flag=1
    for i in range(int(n/2)):
        if bun[i]!=bun[n-1-i]:
            flag=2
            break
    return(flag)

s=input()
N=len(s)

a=kaibun(s)

ss=s[:int((N-1)/2)]
sss=s[int((N+3)/2)-1:]

b=kaibun(ss)
c=kaibun(sss)

if a+b+c==3:
    print("Yes")
else:
    print("No")

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

ls_S = list(S)
rv_S = ls_S.copy()
rv_S.reverse()

comment = False

if ls_S == rv_S:
    Sf = ls_S[0:int((N-1)/2)]
    Sf_rv = Sf.copy()
    Sf_rv.reverse()
    if Sf_rv == Sf:
        Sb = ls_S[int((N+3)/2 - 1):]
        Sb_rv = Sf.copy()
        Sb_rv.reverse()
        if Sb_rv == Sb:
            comment = True

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

Solution (Python):
s=list(input())

length1 = int((len(s)-1)/2-1)
length2 = int((len(s)+3)/2-1)

if s == list(reversed(s)) and s[:length1+1] == list(reversed(s[:length1+1])) and s[length2:] == list(reversed(s[length2:])):
    print('Yes')
else:
    print('No')

Solution (Python):

def isKaibun(s):
    
    if len(s) % 2 == 1:
        return s[:len(s)//2] == s[len(s)//2+1:][::-1]
    
    else:
        return s[:len(s)//2] == s[len(s)//2:][::-1]


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

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

head_s = s[0:(n-1)//2]
tail_s = s[(n+3)//2-1:]
if s == s[::-1] and head_s == head_s[::-1] and tail_s == tail_s[::-1]:
    print('Yes')
else:
    print('No')

Solution (Python):
import math
def A():
    N, M = map(int, input().split())
    if N == 1 == M:
        print(0)
        return
    ans = 0
    if N > 1:
        ans += math.factorial(N)//(2*(math.factorial(N-2)))
    if M > 1:
        ans += math.factorial(M)//(2*(math.factorial(M-2)))
    print(ans)

def B():
    S = input()
    if not S:
        print('No')
        return
    
    
    
    
    
    for i in range(len(S)):
        if not S[i] == S[len(S)-i-1]:
            print('No')
            return
    for i in range((len(S)-1)//2):
        if not S[i] == S[(len(S)-1)//2-i-1]:
            print('No')
            return
        if not S[(len(S)+3)//2+i-1] == S[len(S)-i-1]:
            print('No')
            return
    print('Yes')
B()

Solution (Python):
s = input()

n = len(s)
ss1 = s[:int((n-1)/2)]
ss = s[int((n+3)/2)-1:]

if s != s[::-1]:
    print('No')
    exit()
if s[:int((n-1)/2)] != ss1[::-1]:
    print('No')
    exit()
if s[int((n+3)/2)-1:] != ss[::-1]:
    print('No')
    exit()

print('Yes')

Solution (Python):
s = list(input())
n = len(s)
s_0 = s[:(n-1)//2]
s_1 = s[(n+1)//2:]
if s_0 == s_0[::-1] and s_1 == s_1[::-1] and s == s[::-1]:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
a = [c for c in s]

n = len(a)
r_a = a[::-1]

f = a[0:int((n-1)/2)]
r_f =f[::-1]

l = a[int((n+1)/2):]
r_l =l[::-1]

if (a==r_a)and(f==r_f)and(l==r_l):
  print("Yes")
else:
  print("No")