Problem:


Score : 200 points

Problem Statement

A string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:

S is a palindrome.

Let N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.

The string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.

Determine whether S is a strong palindrome.

Constraints

S consists of lowercase English letters.

The length of S is an odd number between 3 and 99 (inclusive).

Input

Input is given from Standard Input in the following format:

S

Output

If S is a strong palindrome, print Yes;
otherwise, print No.

Sample Input 1

akasaka

Sample Output 1

Yes

S is akasaka.

The string formed by the 1-st through the 3-rd characters is aka.

The string formed by the 5-th through the 7-th characters is aka.
All of these are palindromes, so S is a strong palindrome.

Sample Input 2

level

Sample Output 2

No

Sample Input 3

atcoder

Sample Output 3

No



Sample input:
akasaka


Sample output:
Yes

Submission status: Accepted

Solution code:
s = input()
s_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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

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

def is_kaibun(s):
    #print("checking:", s)
    rev_s = ''.join(list(reversed(s)))
    #print(s, rev_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


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)]

#print(firstS, secondS)

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

#print(ans)

for i in range(len(secondS)) :
    if secondS[i] != secondS[len(secondS)-1-i] :
        ans = False
    #print(s[i], s[len(secondS)-1-i])
    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) :
    #print(i, len(s) // 2 -1 - i, s[i], s[len(s) // 2 -1 - i])
    if s[i] != s[len(s) // 2 -1 - i] :
        ans = False

#print(ans)

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env 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")


# region fastio

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

# endregion

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
s = input()

def isKaibun(s):
    l = int(len(s)/2)
    #print(l, s[0:l])
    f = True
    
    for i in range(l):
        #print(s[i], s[-(i+1)])
        if s[i] != s[-(i+1)]: f = False
    return f
    
def isStrongKaibun(s):
    #print(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")

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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]:
    # print((S[i], S[N-i]))
    ans = False
    break

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC159 B

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# kaibun

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

Submission status: Accepted

Solution code:
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():    
    # T = int(input().strip())
    for _ in range(1):
        solution()

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

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


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


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S=input()
N=len(S)
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")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

s_r = list(reversed(s))
#print(s,n,s_r)

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


if s == s_r:
    x = s[:a]
    y = s[b:]
#    print(x,y,reversed(x))
    if x == list(reversed(x)) and y == list(reversed(y)):
        print('Yes')
        exit()
print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

ls_S = list(S)
rv_S = ls_S.copy()
rv_S.reverse()
# print(ls_S, rv_S)
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')

Submission status: Accepted

Solution code:

def isKaibun(s):
    # odd
    if len(s) % 2 == 1:
        return s[:len(s)//2] == s[len(s)//2+1:][::-1]
    # even
    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')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)//4):
    #     # print(S[i], S[len(S)//2-i-1], S[len(S)//2+i+1], S[-i-1])
    #     if not (S[i] == S[(len(S)-1)//2-i-1] == S[(len(S)+3)//2+i-1] == S[-i-1]):
    #         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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

n = len(a)
r_a = a[::-1]
#print(a,r_a)
f = a[0:int((n-1)/2)]
r_f =f[::-1]
#print(f,r_f)
l = a[int((n+1)/2):]
r_l =l[::-1]
#print(l,r_l)
if (a==r_a)and(f==r_f)and(l==r_l):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
flag = 1
c = int((n - 1) / 2)

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

if flag:
    c2 = int(c / 2)
    for i in range(c2):
        if s[i] != s[c - 1 - i]:
            flag = 0
            break

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

Submission status: Accepted

Solution code:
import math

S=str(input())
N=len(S)
M=(N-1)//2

T=str()
U=str()

for i in range(M):
    T+=S[i]

for j in range(M+1,N):
    U+=S[j]

def check(letter):
    length=len(letter)
    number=math.floor(length)-1
    answer=1
    for x in range(number):
        if letter[x]!=letter[length-1-x]:
            answer=0
    return answer

Ans=min(check(S),check(T),check(U))

if Ans==1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from copy import deepcopy

S = input()
N = len(S)
two = deepcopy(S[:int((N-1)/2):1])
three = deepcopy(S[int((N+3)/2)-1:N:1])

if S == S[::-1] and two == two[::-1] and three == three[::-1]:
  print("Yes")
  exit()
print("No")

Submission status: Accepted

Solution code:
S = list(str(input()))
N = len(S)
if ((N-1)//2)%2:
  n = (N-1)//2
  e = (n-1)//2
  s = (n+3)//2-1
else:
  n = N//2
  e = n//2
  s = n//2
#print(S[:(N-1)//2] , S[(N+3)//2-1:] , S[:e], S[s:n])
if S[:(N-1)//2] == S[(N+3)//2-1:] and S[:e] ==  S[s:n][::-1]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def B159():
    S = list(input())
    N = len(S)
    A = ""
    B = ""
    for i in range(0, int((N-1)/2)):
        A += S[i]
    for i in range(int((N+3)/2) - 1, N):
        B += S[i]

    if A == B:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    B159()

Submission status: Accepted

Solution code:
s = input()


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

ans = 'Yes'

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


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

print(ans)

Submission status: Accepted

Solution code:
def so():
    s=input()
    if s==s[::-1]:
        a=s[0:int((len(s)-1)/2)]
        if a==a[::-1]:
            b=s[int((len(s)+3)/2-1):]
            if b==b[::-1]:
                return "Yes"
    return "No"
print(so())

Submission status: Accepted

Solution code:
S = input()
a = 0
for i in range(len(S)):
    if S[i] == S[len(S)-i-1]:
        a += 1

b = 0
x = int((len(S)-1)/2)
for j in range(x):
    if S[j] == S[x -1 -j]:
        b += 1

c = 0
y = int((len(S)+3)/2)
for k in range(y-1,len(S)):
    if S[k] == S[y-k-2]:
        c += 1

if a == len(S):
    if b == x:
        if c == len(S) - y + 1:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
# 200322 B

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

S = input()
N = len(S)


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

Submission status: Accepted

Solution code:
s = input()

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

t = s[::-1]
t1=s1[::-1]
t2=s2[::-1]

if s==t and s1==t1 and s2==t2:
	print('Yes')
else: 
	print('No')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
if n == 3:
    print("Yes")
elif (n//2)%2 == 0:
    l, r = s[:(n-1)//2], s[(n+1)//2:]
    m = len(l)
    ll, lr = l[:(m)//2], l[(m)//2:]
    rl, rr = l[:(m)//2], l[(m)//2:]
    if ll == lr[::-1] and rl == rr[::-1] and l == r:
        print("Yes")
    else:
        print("No")
else:
    l, r = s[:(n-1)//2], s[(n+1)//2:]
    m = len(l)
    ll, lr = l[:(m-1)//2], l[(m+1)//2:]
    rl, rr = l[:(m-1)//2], l[(m+1)//2:]
    if ll == lr[::-1] and rl == rr[::-1] and l == r:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
f = S[:((len(S) - 1) // 2)]
b = S[((len(S) + 3) // 2) - 1:]
r = ''.join(reversed(list(S)))

if f == b and S == r:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = list(input())
#print(S)
#print(len(S))

a=int((len(S)-1)/2)

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[:a]) and is_kaibun(S[a+1:]):
        print('Yes')

else:
    print('No')

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

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

if is_kaibun(s) and is_kaibun(s_1) and is_kaibun(s_2):
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
def kaibun(s):
    if len(s) == 2:
        if s[0] == s[1]:
            return 1
        else:
            return 0
    else:
        h = int(len(s) / 2)
        for a, b in zip(s[:h], reversed(s[h+1:])):
            if a != b: return 0
        return 1

line = input()
n = len(line)
mae = int((n-1)/2)
usiro = int((n+3)/2)-1
kaibun1 = line[0:mae]
kaibun2 = line[usiro:]

if kaibun(line) == 1 and kaibun(kaibun1) == 1 and kaibun(kaibun2) == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
import math
i=0
S=input()
n=int(len(S))
if S==S[::-1]:
    i=i+1
foreS=S[:int((n-1)/2)]
backS=S[int((n+1)/2):]
if foreS==foreS[::-1]:
    i=i+1
if backS==backS[::-1]:
    i=i+1
if i==3:
    print("Yes")
else:
    print("No")