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)
flag = True
for i in range(n):
    if s[i] != s[n - i - 1]:
        flag = False

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

for i in range((n + 3) // 2, n):
    if s[i] != s[n - i - 1]:
        flag = False
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

S = input()
N = len(S)

def a():
    if not(isPalin(S)):
        return False
    if not(isPalin(S[:(N-1)//2])):
        return False
    if not(isPalin(S[(N+3)//2-1:])):
        return False
    return True

print(["No","Yes"][a()])

Submission status: Accepted

Solution code:
# ANSHUL GAUTAM
# IIIT-D

from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *				# l.sort(key=lambda l1:l1[0]-l1[1]) => ex: sort on the basis difference
from bisect import *				# bisect_left(arr,x,start,end)  => start and end parameters are temporary
from sys import stdin				# bisect_left return leftmost position where x should be inserted to keep sorted
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
from collections import defaultdict # d = defaultdict(list)

'''
akasaka
'''

def solve(s):
	n = len(s)
	a = s[:((n-1)//2)]
	b = s[((n+3)//2)-1:]
	# print(a,b)
	return 'Yes' if(s == s[::-1] and a == a[::-1] and b == b[::-1]) else 'No'
	

s = input()
ans = solve(s)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
for i in range(n//2):
    if not s[i] == s[(n-3)//2-i] == s[(n+1)//2+i] == s[-(i+1)]:
        print('No')
        break
else: print('Yes')

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
S = input()
n = len(S)
a = S[::-1]

ans = "Yes"
if S != a: ans = "No"
elif S[:(n-1)//2] != S[(n+3)//2-1:]: ans = "No"
print(ans)

Submission status: Accepted

Solution code:
import sys
import itertools
import bisect
from operator import itemgetter
 
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()
def combi(n, r):
  r = min(r, n-r)
  numer = denom = 1
  for i in range(1, r+1):
    numer = numer * (n+1-i) %mod
    denom = denom * i %mod
  return numer * pow(denom, mod-2, mod) %mod

s = S()
N = len(s)//2

if s[:N] == s[N+1:]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline().strip()


S = input()
N = len(S)

for i in range(N // 2):
    if S[i] == S[N - i - 1]:
        continue
    else:
        print("No")
        sys.exit()

for i in range(N // 4):
    if S[i] == S[(N - 1) // 2 - i - 1]:
        continue
    else:
        print("No")
        sys.exit()
    if S[(N + 1) // 2 + i] == S[N - i - 1]:
        continue
    else:
        print("No")
        sys.exit()
print("Yes")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
if S != S[::-1]:
    print('No')
    exit()

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

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

print('Yes')

Submission status: Accepted

Solution code:
def inpl():
    return list(map(int, input().split()))


S = input()
N = len(S)


def palidrome(S):
    return all(a == b for a, b in zip(S, S[::-1]))


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

Submission status: Accepted

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

ans = 'Yes'
if s != s[::-1]:
    ans = 'No'
elif s[:int((n-1)/2)] != s[:int((n-1)/2)][::-1]:
    ans = 'No'
elif s[int(((n+3)/2)-1):] != s[int(((n+3)/2)-1):][::-1]:
    ans = 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
# import numpy as np
# import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    s = list(input())
    n = len(s)
    for i in range(n//2):
        if s[i] != s[-1-i]:
            print('No')
            return
    for i in range(((n-1)//2)//2):
        if s[i] != s[(n-1)//2-1-i]:
            print('No')
            return
    s.reverse()
    for i in range(((n-1)//2)//2):
        if s[i] != s[(n-1)//2-1-i]:
            print('No')
            return
    print('Yes')    
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:

S = input().strip()
s = S[:len(S)//2]
print('Yes' if S == S[::-1] and s == s[::-1] else 'No')

Submission status: Accepted

Solution code:
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

S = sr()
bl = True
if S != S[::-1]:
    bl = False
N = len(S)
N = (N-1) // 2
if S[:N] != S[:N][::-1]:
    bl = False

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

s = input()
n = len(s)

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

Submission status: Accepted

Solution code:
def judge(s):
    N = len(s)
    if s[::-1] != s:
        return False

    a = s[:(N-1)//2]
    if a[::-1] != a:
        return False

    b = s[(N+3)//2-1:]
    if b[::-1] != b:
        return False

    return True


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
#input = sys.stdin.buffer.readline
 
def main():
    S = input()
    l = len(S)
    a = S[:(l-1)//2]
    b = S[(l-1)//2+1:]
    
    if S == S[::-1] and a == a[::-1] and b == b[::-1]:
        print("Yes")
    else:
        print("No")
    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
S = list(input())[: -1]
N = len(S)
if S[: : -1] != S:
  print("No")
  exit(0)
if S[: N // 2][: : -1] != S[: N // 2]:
  print("No")
  exit(0)
S.reverse()
if S[: N // 2][: : -1] != S[: N // 2]:
  print("No")
  exit(0)
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):
    N = len(S)
    head = S[:(N-1)//2]
    tail = S[(N-1)//2+1:]

    reversed_head = head[::-1]
    reversed_tail = tail[::-1]
    reversed_S = S[::-1]
    if head == reversed_head and tail == reversed_tail and reversed_S == S:
        print(YES)
    else:
        print(NO)
    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 = list(input())
n = len(s)
m = n // 2

a = [] + s[:m]
b = [] + s[m+1:]

for i in range(m):
    if a[i] != a[m-1-i] or b[i] != b[m-1-i] or a[i] != b[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 isRotStr(S):
    for i in range(len(S)//2):
        if S[i] != S[len(S)-i-1]:
            return False
    return True

def solve(S: str):
    N = len(S)
    print(YES if isRotStr(S) and isRotStr(S[0:(N-1)//2]) and isRotStr(S[(N+2)//2:N]) else NO)
    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)
t = s[:(n//2)]
print('Yes' if s == s[::-1] and t == t[::-1] else 'No')

Submission status: Accepted

Solution code:
S = raw_input()
print "Yes" if S==S[::-1] and S[:len(S)/2]==S[:len(S)/2][::-1] else "No"

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline
read = sys.stdin.read


#n,m = [int(i) for i in read().split()]

s = input()

n = len(s)
t = s[:(n-1)//2]
u = s[(n-1)//2+1:]

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

s = input().rstrip()
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:
def is_palindrome(s):
    return s == s[-1::-1]


S = input()
N = len(S)

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
n = len(s)

if s != s[::-1]:
    print('No')
    quit()
if s[:n//2] != s[:n//2][::-1]:
    print('No')
    quit()
if s[n//2+1:] != s[n//2+1:][::-1]:
    print('No')
    quit()
print('Yes')

Submission status: Accepted

Solution code:
s=input()
nagasa=len(s)
zenhan=(nagasa-1)//2
zen=s[:zenhan]
kou=s[-zenhan:]
if zen==zen[::-1] and kou==kou[::-1] and s==s[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def is_ok(t):
    for c, rc in zip(t, t[::-1]):
        if c != rc:
            return False
    return True


def main():
    s = input()
    N = len(s)
    cond = is_ok(s) and is_ok(s[:(N - 1) // 2]) and is_ok(s[-1 + (N + 3) // 2:])
    print('Yes' if cond else 'No')


if __name__ == '__main__':
    main()

# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

Submission status: Accepted

Solution code:
s=input().strip()
n=len(s)
a=s[0:(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:
S = input()
N = len(S)
A = S[:(N-1)//2]
B = S[(N+3)//2-1:]
def f(s):
    k = 0
    b = s[::-1]
    for i in range(len(s)):
        if s[i]==b[i]:
            k+=1
    return True if k==len(s) else False
print("Yes" if f(S) and f(A) and f(B) else "No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
flag = False
if S == S[::-1]:
    if S[:(N-1)//2] == S[:(N-1)//2][::-1]:
        if S[((N+3)//2) - 1:] == S[((N+3)//2) - 1:][::-1]:
            flag = True
if flag:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def valid():
    S = input()
    N = len(S)
    if S != S[::-1]:
        return False

    sub = S[0:(N-1) // 2] 
    if sub != sub[::-1]:
        return False

    sub = S[(N+3)//2-1:]
    if sub != sub[::-1]:
        return False

    return True

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

Submission status: Accepted

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


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


ans = 'Yes' if check(s) and check(s[:(n - 1) // 2]) and check(s[(n + 1) //
                                                                2:]) else 'No'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
s_1 = s[::-1]

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

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

if(s==s_1)&(s_2a==s_2b)&(s_3a==s_3b):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

N = len(S)
M = N // 2
A = S[:M]
B = S[M + 1:]

flag = True
for i in range(M):
  if A[i] != B[-1 - i]:
    flag = False
  if A[i] != A[-1 - i]:
    flag = False

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

if S != S[::-1]:
    print('No')
    sys.exit()

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

if T != T[::-1]:
    print('No')
    sys.exit()

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

if U != U[::-1]:
    print('No')
    sys.exit()

print('Yes')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

s = input()
n = len(s)
a,b,c = 0,0,0
if s == s[::-1]:a=1
if s[:n//2] == s[:n//2][::-1]:b = 1
if s[n//2+1:] == s[n//2+1:][::-1]: c = 1
if a and b and c:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=len(s)
ss=s[:n//2]
sss=s[n//2+1:]
f1=all(i==j for i,j in zip(s,s[::-1]))
f2=all(i==j for i,j in zip(ss,ss[::-1]))
f3=all(i==j for i,j in zip(sss,sss[::-1]))
if f1 and f2 and f3:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()

L = len(S)
S2 = S[:L//2]
S3 = S[-(L//2):]
if S == S[::-1] and S2 == S2[::-1] and S3 == S3[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
from collections import Counter, defaultdict, deque

S = input().rstrip()
N = len(S)


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


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

Submission status: Accepted

Solution code:

S = input()
N = len(S)

flag = "Yes"

for i in range(len(S)):

    if S[i] != S[len(S)-1-i]:
        flag = "No"

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


for i in range(len(T)):

    if T[i] != T[len(T)-1-i]:
        flag = "No"

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



for i in range(len(U)):

    if U[i] != U[len(U)-1-i]:
        flag = "No"

print (flag)

Submission status: Accepted

Solution code:
S = input()

flg1 = S == S[::-1]

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

s2 = S[(len(S) + 3) // 2 - 1:]
flg3 = s2 == s2[::-1]

if flg1 and flg2 and flg3:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

si = s[::-1]

ans = 'Yes'

for i in range(n):
    if s[i] != si[i]:
        ans = 'No'

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

for i in range((n-1)//2):
    if s[i] != sa[i]:
        ans ='No'

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

for i in range((n-1)//2):
    if s[i] != sb[i]:
        ans = 'No'

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

S1 = S[:(N - 1) // 2]
S2 = S[(N + 1) // 2:]
#print(S1, S2)

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

Submission status: Accepted

Solution code:
S = input()
n = len(S)
ans = True
if S!=S[::-1]:
    ans = False
s = S[:(n-1)//2]
if s!=s[::-1]:
    ans = False
s = S[::-1][(n-1)//2]
if s!=s[::-1]:
    ans = False
if ans:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()
n = len(s)
t = s[:n // 2]
k = s[-n//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)


def check(r):
    if r == r[::-1]:
        return True


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

def check(s):
    m = len(s)
    return all(s[i] == s[m-1-i] for i in range((m+1)//2))

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

Submission status: Accepted

Solution code:
s=input()
def isp(st): return True if st == st[::-1] else False

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

Submission status: Accepted

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

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

Submission status: Accepted

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


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
n = len(s)
m = (n-1)//2
if s != s[::-1]:
  print('No')
  exit()
t = s[:m]
if t != t[::-1]:
  print('No')
  exit()
if s[:m] != s[-m:]:
  print('No')
  exit()
print('Yes')

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

def func(s):
    return s == s[::-1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    S=list(input())
    T=list(reversed(S))
    N=len(S)
    for a,b in zip(S,T):
        if a!=b:
            print('No')
            exit()
    U=S[:(N-1)//2]
    V=list(reversed(U))
    for a,b in zip(U,V):
        if a!=b:
            print('No')
            exit()
    print('Yes')
    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

N = len(S)
A = S[:N//2]
B = S[N//2 + 1:]

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

Submission status: Accepted

Solution code:
S= input()
N = len(S)
x = S[0:(N-1)//2]
y = S[(N+3)//2-1:N]
if S==S[::-1] and x==x[::-1] and y==y[::-1]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
s = input()

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

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

if check(s) and check(s1) and check(s2):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

N = len(S)
m = N//2
s1,s2 = S[:m],S[m+1:]
if s1 == s2[::-1] and s1 == s2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

s = ns()

def go(s):
    return s == s[::-1]

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

Submission status: Accepted

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
S=input()
n=len(S)
if S==S[::-1] and S[:(n-1)//2]==S[(n+3)//2-1:]:
  
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

po = input().split()[0]
n = len(po)
if po == po[::-1]:
    a = po[:n//2]
    b = po[n//2+1:]
    if a == a[::-1] and b == b[::-1]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
flag = 1

t = s[:(len(s)-1)//2]

for i in range(len(t)):
    if t[i] == t[-1-i]:
        continue
    else:
        flag = 0
t = s[(len(s)+3)//2-1:]
for i in range(len(t)):
    if t[i] == t[-1-i]:
        continue
    else:
        flag = 0
for i in range(len(s)):
    if s[i] == s[-1-i]:
        continue
    else:
        flag = 0
if flag == 1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

L = len(S)
T = S[::L//2]
U = S[L//2+1:]

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

Submission status: Accepted

Solution code:
s = input()

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

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

# print(s2, s3)

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

Submission status: Accepted

Solution code:
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

S = sys.stdin.buffer.readline().decode().rstrip()


def ok1():
    N = len(S)
    s = S[:(N - 1) // 2]
    return s == s[::-1]


def ok2():
    N = len(S)
    s = S[(N + 3) // 2 - 1:]
    return s == s[::-1]


ok = True
ok &= S == S[::-1]
ok &= ok1()
ok &= ok2()
if ok:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S=input()
N=len(S)
def f(s): return s==s[::-1]
print("YNeos"[not(f(S) and f(S[:(N-1)//2]) and f(S[(N+3)//2-1:]))::2])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def judge(x):
  n = len(x)
  flg = 1
  for i in range(n//2):
    if x[i] != x[-i-1]:
      flg = 0
  return flg
s = input()
n = len(s)
if judge(s) and judge(s[:n//2]):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()
a = S[:len(S)//2]
b = S[len(S)//2+1:]
if S == S[::-1] and a == a[::-1] and b == b[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
import sys
s = input()
if s == s[::-1]:
    x = s[:(len(s)-1)//2]
    if x == x[::-1]:
        y = s[(len(s)+3)//2 -1:]
        if y == y[::-1]:
            print('Yes')
            sys.exit()
print("No")

Submission status: Accepted

Solution code:
import sys
from fractions import gcd
from itertools import groupby as gb
from itertools import permutations as perm
from itertools import combinations as comb
from collections import Counter as C
from collections import defaultdict as dd
sys.setrecursionlimit(10**5)
def y(f):
    if f:
        print('Yes')
    else:
        print('No')
def Y(f):
    if f:
        print('YES')
    else:
        print('NO')
def Z(f):
    if f:
        print('Yay!')
    else:
        print(':(')
def ispow(n):
    if int(n**.5)**2==n:
        return True
    return False

s = input()
n = len(s)
a = s[:n//2]
b = s[(n+1)//2:]
def f(s):
    return s == s[::-1]
y(f(s) and f(a) and f(b))