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

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

if f(s1)==True and f(s2)==True and f(S)==True:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()

N = len(S)

ans = True
for i in range(N//2):
    ans = ans and S[i]==S[N-1-i]

S1 = S[:N//2]
S2 = S[N//2+1:]
N2 = len(S1)

for i in range(N2//2):
    ans = ans and S1[i] == S1[N2-1-i]
    ans = ans and S2[i] == S2[N2-1-i]

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

Submission status: Accepted

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

a = S[:(L-1)//2]
b = S[(L-1)//2+1:]

flg = S == S[::-1]
if flg: flg = a == a[::-1]
if flg: flg = b == b[::-1]

print("Yes" if flg else "No")

Submission status: Accepted

Solution code:
s = input()


def isKai(t):
  return list(t) == list(reversed(list(t)))


n = len(s)

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

Submission status: Accepted

Solution code:
#create date: 2020-03-22 21:03

import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    s = ns()
    n = len(s)
    s1 = s[:(n-1)//2]
    s2 = s[(n+3)//2-1:]
    ans = "Yes"
    if s == s[::-1] and s1 == s1[::-1] and s2 == s2[::-1]:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = list(input())

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

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

l = s[(len(s) + 3) // 2 - 1:len(s)]
for i in range(len(l) // 2):
    if l[i] != l[len(l) - i - 1]:
        print("No")
        exit()

print("Yes")

Submission status: Accepted

Solution code:
def examA():
    N, M = LI()
    ans = N*(N-1)//2 + M*(M-1)//2
    print(ans)
    return

def examB():
    def judge(A):
        #print(A)
        n = len(A)
        for i in range(n//2):
            if A[i]!=A[n-i-1]:
                return False
        return True
    S = SI()
    N = len(S)
    if not judge(S):
        print("No")
        return
    if judge(S[:(N-1)//2]) and judge(S[(N+1)//2:]):
        print("Yes")
    else:
        print("No")
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**6)

if __name__ == '__main__':
    examB()

"""

"""

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial
from bisect import bisect_left #bisect_left(list, value)
#from fractions import gcd
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input():
    return sys.stdin.readline()[:-1]
def pri(x):
    if type(x) is list:
        print('\n'.join(map(str, x)))
    else:
        print(x)

S = input()
N = len(S)
rS = ''.join(list(reversed(S)))

S2 = S[:(N-1)//2]
rS2 = ''.join(list(reversed(S2)))

S3 = S[(N+3)//2-1:]
rS3 = ''.join(list(reversed(S3)))

if S==rS and S2==rS2 and S3==rS3:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

n = len(s)

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

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

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

Submission status: Accepted

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

def ri():
    return int(input())

def rl():
    return list(input().split())

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

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in range(N):
    if S[i]!=S[N-i-1]:
        out = 1
for i in range(len(A)):
    if A[i]!=A[len(A)-i-1]:
        out = 1
for i in range(len(B)):
    if B[i]!=B[len(B)-i-1]:
        out = 1

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

Submission status: Accepted

Solution code:


s = input()

flag = s == s[::-1]
n = len(s)
cond2 = s[:(n-1)//2]
flag &= cond2 == cond2[::-1]
cond3 = s[(n+3)//2-1:]
flag &= cond3 == cond3[::-1]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input().strip()
N = len(S)
R = S[::-1]

if S != R:
    print('No')
    exit()

S2 = S[:(N-1)//2]
R2 = S2[::-1]
if S2 != R2:
    print('No')
    exit()

S3 = S[(N+3)//2-1:]
R3 = S3[::-1]
if S3 != R3:
    print('No')
    exit()

print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
t=s[0:(len(s)-1)//2]
u=s[(len(s)+3)//2-1:]

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

Submission status: Accepted

Solution code:
def main():
    s = input()

    def kaibun(seq):
        l = len(seq)
        for i in range(l//2):
            if seq[i] != seq[-i-1]:
                return False
        return True
    n = len(s)
    if kaibun(s) and kaibun(s[:(n-1)//2]) and kaibun(s[(n+3)//2-1:]):
        print("Yes")
    else:
        print("No")


main()

Submission status: Accepted

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

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


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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

s = input()
n = len(s)
for i in range(n//2+1):
    if s[i] == s[n-i-1]:
        continue
    print('No')
    quit()
for i in range((n//2)//2+1):
    if s[i] == s[n//2-i-1]:
        continue
    print('No')
    quit() 
s = s[(n+3)//2-1:]
for i in range((n//2)//2+1):
    if s[i] == s[n//2-i-1]:
        continue
    print('No')
    quit() 
print('Yes')

Submission status: Accepted

Solution code:
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(1000000)

# INF = float('inf')
INF = int(1e10)

def input():
    return stdin.readline()[:-1]

def is_kaibun(S):
    flag = True
    # print(S)
    for i in range((len(S) + 1) // 2):
        # print(i, S[i], S[len(S) - i - 1])
        if S[i] != S[len(S) - i - 1]:
            flag = False
            break
    return flag

def main():
    from builtins import int, map
    S = input()
    N = len(S)
    if is_kaibun(S) and is_kaibun(S[:N // 2]) and is_kaibun(S[N // 2 + 1:]):
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# B
s = input()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def isparin(t):
    #print(t)
    M=len(t)
    for i in range(M):
        if t[i]!=t[M-1-i]:
            return False
    return True

S=input()
N=len(S)

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

Submission status: Accepted

Solution code:
import sys
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

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

f_half = S[:len(S) // 2]
s_half = S[(len(S) + 2) // 2:]

if f_half == s_half:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
def palin(s):
  p = 1
  n = len(s)
  for i in range(n//2):
    if s[i] != s[n-i-1]:
      p = 0
      break
  return p == 1
if palin(S) and palin(S[:(N-1)//2]) and palin(S[(N+2)//2:]):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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


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

if is_kaibun(s) and is_kaibun(s[0:(l-1)//2]) and is_kaibun(s[(l+1)//2:]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:

def kai(s):
    n = len(s)
    for i in range(n):
        if s[i]!=s[n-1-i]:
            return False
    return True

def main():
    S = input()
    N=len(S)
    if kai(S) and kai(S[:(N-1)//2]) and kai(S[(N+1)//2]):
        return "Yes"
    return "No"

print(main())

Submission status: Accepted

Solution code:
S = input()
n = len(S)
S1 = S[:(n-1)//2]
S2 = S[(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:
import sys

def solve():
    input = sys.stdin.readline
    s = input().strip("\n")
    N = len(s)
    rev = ""
    for i in reversed(range(N)): rev += s[i]
    if s == rev:
        revl = ""
        revr = ""
        for i in reversed(range((N - 1) // 2)): 
            revl += s[i]
        for i in reversed(range((N + 3) // 2 - 1, N)):
            revr += s[i]
        if s[:(N-1)//2] == revl and s[(N+3)//2 - 1: N] == revr: print("Yes")
        else: print("No")
        #print(s, revl, revr, s[:(N-1)//2], s[(N+3)//2 - 1: N])
    else: 
        print("No")

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
s = "x" + input()
n = len(s)

a = s[1:]
l = s[1:(n-1)//2 + 1]
r = s[(n+3)//2:]

if a == a[::-1] and l == l[::-1] and r == r[::-1]:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()
yes = True

for num in range(len(S)):
    if S[num] != S[len(S)-num-1]:
        yes = False

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

for num in range(len(S)):
    if S[num] != S[len(S)-num-1]:
        yes = False

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
t = s[:n // 2]
u = s[n // 2 + 1:]
print(["No", "Yes"][s == s[::-1] and t == t[::-1] and u == u[::-1]])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
def check(s):
    return s == s[::-1]

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
S = input().strip()

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

if kaibun(S) and kaibun(S[:(len(S)-1)//2]) and kaibun(S[(len(S)-1)//2+1]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

ls = s[:int((len(s)-1)/2)]
rs = s[int((len(s)-1)/2)+1:]

if ls == rs:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def palindrome(s):
    #print(s)
    n = len(s)
    for i in range(n//2):
        if s[i] != s[n-1-i]:
            return False

    return True

def main():
    s = input()
    if not palindrome(s):
        print('No')
        return

    n = len(s)
    s1 = s[:(n-1)//2]
    if not palindrome(s1):
        print('No')
        return

    s2 = s[((n+3)//2)-1:]
    if not palindrome(s2):
        print('No')
        return

    print('Yes')
    


main()

Submission status: Accepted

Solution code:
def f(q):
    for i in range(len(q)):
        if q[i]!=q[len(q)-1-i]: return 0
    return 1

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    from sys import stdin
    input = stdin.readline

    s = input()[:-1]
    n = len(s)
    for a, b in zip(s, s[::-1]):
        if a != b:
            print('No')
            exit()
    for a, b in zip(s[:(n-1)//2], s[(n-3)//2:0:-1]):
        if a != b:
            print('No')
            exit()
    for a, b in zip(s[(n+1)//2:], s[::-1]):
        if a != b:
            print('No')
            exit()
    print('Yes')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# coding: utf-8
import sys
sys.setrecursionlimit(10000000)

#const
dxdy=((1,0),(0,1))
# my functions here!
def pin(type=int):
    return map(type,input().rstrip().split())
"""  
def resolve():
    N,M=pin()
    print(N*(N-1)//2+M*(M-1)//2)
""" 
def resolve():
    S=input()
    N=len(S)
    S2=(S[0:(N-1)//2])
    S3=(S[(N+3)//2-1:N])
    print(["No","Yes"][S==S[::-1] and S2==S2[::-1] and S3==S3[::-1]])
"""         
#printデバッグ消した？
#前の問題の結果見てないのに次の問題に行くの？
"""
"""
お前カッコ閉じるの忘れてるだろ
"""
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """akasaka"""
        output = """Yes"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """level"""
        output = """No"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """atcoder"""
        output = """No"""
        self.assertIO(input, output)

if __name__=="__main__":resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

# 多次元配列
# dp = [[0] * 3 for _ in range(5)]

# 入力を受け取る
S = input()
l = len(S)

def ok(S):
    for i in range(l):
        if S[i] != S[l - i - 1]:
            return False

    for i in range((l - 1) // 2):
        if S[i] != S[l // 2 - i - 1]:
            return False
        if S[l // 2 + 1 + i] != S[l - i - 1]:
            return False

    return True

print("Yes" if ok(S) else "No")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()

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

s_reversed = ''.join(list(reversed(s)))
s1_reversed = ''.join(list(reversed(s1)))
s2_reversed = ''.join(list(reversed(s2)))

if s == s_reversed and s1 == s1_reversed and s2 == s2_reversed:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
s1 = s[:len(s)//2]
s2 = s[len(s)//2+1:]

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

Submission status: Accepted

Solution code:
def is_palindrome(s):
    # print(s)
    for i in range(len(s) // 2 + 1):
        if s[i] != s[-(i+1)] and '.' not in [s[i], s[-(i+1)]]:
            return False
    return True

s = input()

a = is_palindrome(s)
b = is_palindrome( s[:(len(s)-1)//2])
c = is_palindrome(s[(len(s)+3)//2-1:])

if a and b and c:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
def f(a):
  return a == a[::-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 = list(input())

flag = True
if S != S[::-1]:
    flag = False

N = len(S)

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

if tmp != tmp[::-1]:
    flag = False

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

if tmp != tmp[::-1]:
    flag = False

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

Submission status: Accepted

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

s=input()
n=len(s)//2
if(isp(s) and isp(s[:n])):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
Sr=''.join([S[-i-1] for i in range(N)])
T=''.join([S[i] for i in range(0,(N-1)//2)])
Tr=''.join([T[-i-1] for i in range(0,(N-1)//2)])
U=''.join([S[i] for i in range((N+1)//2,N)])
Ur=''.join([U[-i-1] for i in range(0,(N-1)//2)])
if S==Sr and Tr==T and U==Ur:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

s = list(input().rstrip())
n = len(s)

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

Submission status: Accepted

Solution code:
#n = int(input())
s = input()
#a,b = map(int,input().split())
#da = list(map(int,input().split()))
#a = [int(input()) for i in range(n)]

def cal(x):
    for i in range(len(x)):
        if x[i] != x[-i-1]:
            return False
    return True

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

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
if s != list(reversed(s)):
    print("No")
    exit()
if s[:n//2] != list(reversed(s[:n//2])):
    print("No")
    exit()
if s[(n//2)+1:] != list(reversed(s[(n//2)+1:])):
    print("No")
    exit()
print("Yes")

Submission status: Accepted

Solution code:
def solve():
    S = input()
    N = len(S)
    l = list(S)
    cond = False
    
    s = list(S[:(N-1)//2])
    t = list(S[(N+3)//2-1:])
    
    if l == list(reversed(l)) and s == list(reversed(s)) and t == list(reversed(t)):
        cond = True
    
    return 'Yes' if cond else 'No'

print(solve())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
Ss = input()

N = len(Ss)
S1s = Ss[:N//2]
S2s = Ss[N//2+1:]
#print('S1s:', S1s)
#print('S2s:', S2s)

if Ss == Ss[::-1] and S1s == S1s[::-1] and S2s == S2s[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

def isCyclic(S):
    n = len(S)
    #print(S)
    ans = True
    for i in range(n):
        if S[i] != S[n - i - 1]:
            ans = False
            break
    return ans

if isCyclic(S) and isCyclic(S[:(n - 1) // 2]) and isCyclic(S[(n + 1) // 2:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
S = input()
N = len(S)

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

A = kaibun(S[:(N-1)//2])
B = kaibun(S[(N+1)//2:])
C = kaibun(S)

if A and B and C:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = list(input())

a = len(s)
for i in range(0, (a-1)//2):
    if s[i] == s[a-1-i] == s[(a-3)//2 -i] == s[(a+1)//2+i]:
        continue
    else:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

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

s1 = s[:(n-1)//2]
s2 = s[(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()

n = len(s)
if s == s[::-1]:
    t = s[:(n-1)//2]
    if t == t[::-1]:
        u = s[(n+3)//2-1:]
        if u == u[::-1]:
            print('Yes')
            exit()

print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    N = len(S)
    V = S[:(N-1)//2]
    W = S[(N+1)//2:]
    ans = "Yes"
    for i in range(N//2):
        if S[i] != S[N-1-i]:
            ans = "No"
    M = len(V)
    L = len(W)
    for i in range(M//2):
        if V[i] != V[M-1-i]:
            ans = "No"
    for i in range(L//2):
        if W[i] != W[L-1-i]:
            ans = "No"
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10000000)
INF = 1<<32

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

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

    if N == 3:
        if S == S[::-1]:
            print(YES)
            exit()
        else:
            print(NO)
            exit()

    s1 = S[:(N-1)//2]
    s1r = s1[::-1]
    s2 = S[(N+3)//2]
    s2r = s2[::-1]
    # print(s1, s1r, s2, s2r)
    if S == S[::-1] and s1 == s1r and s2 == s2r:
        print(YES)
    else:
        print(NO)
    return



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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
if len(s)%2!=1:
    print('No')
else:
    res = False
    n = len(s)
    
    t = s[:(n-1)//2]
    u = s[(n+3)//2-1:]
    
    if s==s[::-1]:
        if t==t[::-1]:
            if u==u[::-1]:
                res = True
    print('Yes' if res else 'No')

Submission status: Accepted

Solution code:
def judge(s):
    N = len(s)
    if s != s[::-1]:
        return False
    s1 = s[:N // 2]
    if s1 != s1[::-1]:
        return False
    s2 = s[(N + 1) // 2:]
    if s2 != s2[::-1]:
        return False
    return True


S = input()
print('Yes' if judge(S) else 'No')

Submission status: Accepted

Solution code:
S = input()
T = S[:len(S)//2]
U = S[(1+len(S)//2):]

def kaibun(s):
    for k in range(len(s)//2):
        if s[k] != s[-k-1]:
            return False
    return True
if kaibun(S) == kaibun(U) == kaibun(T) == True:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

sub_s = s[: n // 2]

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

Submission status: Accepted

Solution code:
def check(string):
    return string == string[::-1]
S = input()
N = len(S)
# print(S[:(N-1)//2], S[(N+3)//2-1:])
if check(S) and check(S[:(N-1)//2]) and check(S[(N+3)//2-1:]):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

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

def print_l(l):
    print(' '.join(map(str, l)))

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res


S = s_in()
N = len(S)

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

Submission status: Accepted

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

det = 0
N = len(S)

for i in range(N):
    if S[i] != S[N-i-1]:
        det = -1

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

for i in range((N+1)//2,N):
    if S[i] != S[N-(i-(N+1)//2)-1]:
        det = -1

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

Submission status: Accepted

Solution code:
s = list(input())
n = len(s)
flag = True
for i in range(n//2):
  #print(i, s[i], s[n-i-1])
  if s[i]!=s[n-i-1]:
    flag = False

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

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

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

"""C問題"""


"""D問題"""

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def f(s):
    return s==s[::-1]
s=input()
n=len(s)
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 = list(input())
N = len(S)

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

Submission status: Accepted

Solution code:
from sys import exit, setrecursionlimit
setrecursionlimit(10**6)

def array2D(row, col ,val=0):
    return [[val]*col for i in range(row)]

s = input()
n = len(s)

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

Submission status: Accepted

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