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: Wrong Answer

Solution code:
n = input()
print(n[::-1])
if n == n[::-1]:
    zenhan = n[0:int(len(n)//2)]
    if zenhan == zenhan[::-1]:
        kouhan = n[int(len(n)//2)+1::]

        if kouhan == kouhan[::-1]:
            print('Yes')
            exit()

print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S=input()
n=len(S)
flag=0
S1=S[0:(n-1)//2-1]
S2=S[(n+3)//2+1:]
if S1==S1[::-1] and S2==S2[::-1]:
    pass
else:
    flag=1
print('Yes' if flag==0 else 'No')

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
S2 = S[:int((N-1)/2)]
S3 = S[int((N+3)/2-1):]

def kaibun(string):
    if len(string) > 1:
        if string[0] == string[-1]:
            return kaibun(string[1:-1])
        else:
            return 0
    else:
        return 1
if kaibun(S2) == 1:
    if kaibun(S3) == 1:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

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

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

if s_1 == s_1[::-1] and s_2 == s_2[::-1]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input()

n = len(s)

ans = 0

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

s3 = s1[::-1]
s4 = s2[::-1]

if s1 == s3:
    ans += 1

if s2 == s4:
    ans += 1

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

Submission status: Wrong Answer

Solution code:
s = list(input())
n = len(s)
s1 = s[:int((n-1)/2)]
s2 = s[int((n+3)/2-1):]

def isk(st):
    return st == st[::-1]

print(isk(s) and isk(s1) and isk(s2))

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
m=n//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[:m]) and is_kaibun(s[m+1:]):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:

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

S = input().strip()
if len(S)%2 == 0:
    print('NO')
else:
    if not check_p(S[:(len(S) - 1)//2]):
        print('NO')
    elif not check_p(S[((len(S) + 3)//2) - 1:]):
        print('NO')
    else:
        print('YES')

Submission status: Wrong Answer

Solution code:
def check(st):
  flag = True
  n = len(st)
  for i in range(int(n/2)):
    if st[i] != st[n-1-i]:
      flag = False
  return flag

s=input()
n=len(s)
one = s[0:int((n-1)/2)]
two = s[int(((n+3)/2)) - 1:n]

if check(one) and check(two):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
 
s = input()
n = len(s)
f = 1

ss = s[:(n-1)//2]
for i in range((n-1)//4):
    if not ss[i] == ss[-1*(i+1)]:
        f = 0
        break

ss = s[(n+3)//2-1:]
for i in range((n-1)//4):
    if not ss[i] == ss[-1*(i+1)]:
        f = 0
        break

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

Submission status: Wrong Answer

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

s = input()

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

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = list(map(int, input().split()))
    #a = [list(input().split()) for i in range(n)]
    #a = [int(input()) for i in range(n)]
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    s=list(input())
    n=len(s)
    l1=s[:(n-1)//2]
    l2=s[(n+3)//2-1:]
    print(l1,l2)
    if s==s[::-1] and l1==l1[::-1] and l2==l2[::-1]:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

a = str[0 : (n - 1) // 2]
b = str[(n + 3) // 2 - 1: n]
if check(a) == False or check(b) == False: print("No")
else: print("Yes")

Submission status: Wrong Answer

Solution code:
s = input()

def f(s):
    if s == s[::-1]:
        return True
    return False
n = len(s)
o = (n-1)//2
e = (n+3)//2 - 1
if n <= 3:
    print("No")
elif f(s[:o]) and f(s[e:]):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S=input()
ans=1
for i in range(len(S)//2):
    
    if S[i]==S[len(S)-1-i]:
        ans*=1
    else:
        ans*=2

for j in range((len(S)-1)//4):
    
    if S[j]==S[len(S)//2-1-j]:
        ans*=1
    else:
        ans*=3

if ans==1:
    print("Yes")
else:
    print("NO")

Submission status: Wrong Answer

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

res = s == s[::-1] and t == t[::-1] and u == u[::-1]

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

Submission status: Wrong Answer

Solution code:
s=input()
n=len(s)
a=s[:int((n-1)/2)]
b=s[int((n+3)/2)-1:]
m=len(a)
c=a[:int((m-1)/2)]
d=b[int((m+3)/2)-1:]


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

Submission status: Wrong Answer

Solution code:
s = input()
if all(s[i] == s[len(s)//4 + 1 - i] and s[-i] == s[-len(s)//4 - 1 + i] for i in range(len(s)//4)):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S = input()
N = int(len(S))
A = "Yes"
n = N//2
m = n//2

for i in range(n):
  if S[i] != S[N-1-i]:
    A = "No"
    break
for i in range(m):
  if S[i] != S[m-1-i] or S[n+1+i] != S[N-1-i]:
    A = "No"
    break
print(A)

Submission status: Wrong Answer

Solution code:
S = input()

List = list(S)
N = len(List)
N2 = int((N-1)/2)
ans = 1
arr = []

for i in range(N2):
  if List[i] == List[N-1-i]:
    arr.append(List[i])
  else:
    ans = 0

N3 = len(arr)
if N3 %2 == 0:
  ans = 0

N4 = int((N3-1)/2)
for i in range(N4):
  if arr[i] == arr[N3-1-i]:
    continue
  else:
    ans = 0

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

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)
k = (N - 1) // 2
ans = True
for i in range(k // 2):
    if S[i] == S[k - 1 - i] == S[k + 1 + i] == S[2 * k - i]:
        continue
    ans = False
    break
print('Yes' if ans else 'No')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
S = input()
Sr=''.join(list(reversed(S)))
N=len(S)
S1=S[:int((N-1)/2)]
S1r=''.join(list(reversed(S1)))
S2=S[int((N+3)/2)-1:]
S2r=''.join(list(reversed(S2)))
if S==Sr and S1 ==S1r and S2==S2r:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())

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

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = input()
m = len(n)
if n == n[::-1]:
  k = n[0:(m-1)//2]
  l = n[(m+3)//2-1:m]
  print(k,l)
  if k == k[::-1]:
    if l == l[::-1]:
      print('Yes')
      exit()
print('No')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

s = list(input())
fl = True

sf = list(s)
sf.reverse()

if sf != s:
    fl = False
else:
    s1 = s[:len(s)//2]
    s1r = list(s1)
    s1r.reverse()
    if s1 != s1r:
        fl = False
    else:
        s2 = s[:(len(s) + 3) // 2]
        s2r = list(s2)
        s2r.reverse()
        if s2r != s2:
            fl = False

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
if n == 3:
    print("Yes")
elif n == 5:
    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 and rl == rr:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
import sys
import math
from functools import reduce
from operator import mul
sys.setrecursionlimit(10**6)

def InMap(): return list(map(int, sys.stdin.readline().split(' ')))
def In(): return int(sys.stdin.readline())
def InS(): return sys.stdin.readline()

S = InS()[:-1]

N = len(S)
T = S[:(N-1)//2]
if S[:(N-1)//2] == T[::-1]:
    T = S[(N+1)//2::]
    if S[(N+1)//2::] == T[::-1]:
        print('Yes')
        sys.exit()

print('No')

Submission status: Wrong Answer

Solution code:
import sys
from math import ceil, floor
from collections import deque, Counter, defaultdict
from fractions import gcd
input = lambda: sys.stdin.readline().rstrip()

def eprint(s):
    sys.stderr.write('DEBUG: {}'.format(s))
    return

def is_p(s):
    n = len(s)
    if s[:n//2] == s[n//2+1:]:
        return True
    return False

def main():
    s = input()
    n = len(s)

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

    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def isPalindrome(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 isPalindrome(s[:(N - 1) // 2]) and isPalindrome(s[(N + 3) // 2 - 1:]) else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def is_palindrome(s):
    if len(s) < 1:
        return True
    elif s != s[::-1]:
        return False

    return is_palindrome(s[:len(s) // 2]) and is_palindrome(s[len(s) // 2 + 1:])


if __name__ == '__main__':
    s = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)
S_list = [i for i in S]
S_1 = S_list[:(N-1)//2]
check = 0
for i in range(len(S_1)//2):
    if S_1[i] != S_1[-(i+1)]:
        check = 1

S_2 = S_list[(N+3)//2-1:]
for i in range(len(S_2)//2):
    if S_2[i] != S_2[-(i+1)]:
        check = 1

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
s2 = s[:(n-1)//2]
s3 = s[(n+3)//2-1:]
flug = True
for i in range(len(s2)//2):
    end = -i - 1
    if s2[i] != s2[end]:
        flug = False
        break
for i in range(len(s3)//2):
    end = -i - 1
    if s[i] != s3[end]:
        flug = False
        break
if flug: print("Yes")
else: print("No")

Submission status: Wrong Answer

Solution code:
s = input()

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

n = len(s)

ss = (n-1) // 2

first = s[:ss]
second = s[(ss+1):]


if(is_kaibun(first) and is_kaibun(second)):
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()
N = len(S)
left = S[:N // 2]
right = S[N // 2 + 1:]

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

Submission status: Wrong Answer

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

s = input()

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

Submission status: Wrong Answer

Solution code:
s = input()


def is_kaibun(s):
    if len(s) == 1:
        return True

    l = [0] * (ord("z") - ord("a") + 1)
    for c in s:
        l[ord(c)-ord("a")] += 1

    odd_cnt = 0
    for i in range(len(l)):
        if l[i] % 2 == 1:
            odd_cnt += 1
            if odd_cnt >= 2:
                return False
    return True


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

Solution code:
s = input()

s = list(s)

ans = True

fs = 0
sl = -1
fl = (len(s) - 1) // 2
ss = (len(s) + 3) // 2
for i in range(fl // 2):
    if s[fs+i] == s[fl-i] and s[fl-i] == s[ss+i] and s[ss+i] == s[sl-i]:
        pass
    else:
        ans = False
        break

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

Submission status: Wrong Answer

Solution code:
s = input()
if(s==s[::-1]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = list(input())
x = len(s)
a = s[:x//2]
b = s[x//2+1:]
y = len(a)
c = a[:y//2]
d = a[y//2+1:]
e = b[y//2+1:]
f = b[:y//2]

ans = "No"
if a == b:
    if c == d:
        if a == b:
            ans = "Yes"

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    S = sr()
    N = len(S)
    a = S[:(N-1)//2]
    if (N+3)//2+1 > N:
        print('No')
        return
    b = S[(N+3)//2+1:N]
    if S==S[::-1] and a==a[::-1] and b==b[::-1]:
        print('Yes')
    else:
        print('No')
resolve()

Submission status: Wrong Answer

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

  return True


def test(s):
  if not a(s):
    return "No1"

  n = len(s)
  if not a(s[:(n - 1) // 2]):
    return "No1"

  if not a(s[(n + 3) // 2 - 1:]):
    return "No3"

  return "Yes"


print(test(input().strip())[:2])

Submission status: Wrong Answer

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

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

N2 = len(a)

if a[0:(N2 - 1) // 2] == a[(N2 + 1) // 2:] and b[0:(N2 - 1) // 2] == b[(N2 + 1) // 2:]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
S=input()

n=len(S)
flag=0
S1=S[0:n//2]
S2=S[n//2+1:]
if S1==S1[::-1] and S2==S2[::-1]:
    pass
else:
    flag=1
print('Yes' if flag==0 else 'No')

Submission status: Wrong Answer

Solution code:
s = input()
N=len(s)
s=list(s)
flg=True

def check(s):
    n=len(s)
    if n%2==1:
        lefts=s[:n//2]
        rights=s[n//2+1:]
    else:
        lefts=s[:n//2]
        rights=s[n//2:]
    if lefts!=rights:
        return False
    else:
        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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
n = len(s)
ans = "No"

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

if sa == sa[::-1] and sb == sb[::-1]:
    ans = "Yes"

print(ans)

Submission status: Wrong Answer

Solution code:
#B
S = input()
n = len(S)
a = list(S)
reva = a[n::-1]
sub1 = a[0:int((n-1)/2)]
sub2 = a[int((n+3)/2 + 1):]
if a == reva and sub1 == sub1[len(sub1)::-1] and sub2 == sub2[len(sub2)::-1]:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
def is_pal(s):
    print(s,'s')
    i,j=0,len(s)-1
    while i<=j:
        if s[i]==s[j]:
            i+=1
            j-=1
        else:
            return False
    return True
s=sys.stdin.readline()[:-1]
n=len(s)
if n%2!=0:
    if is_pal(s[:n//2]) and is_pal(s[n//2+1:]) and is_pal(s):
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
s = input().split()[0]
n = len(s)
l = s[:n//2]
r = s[n//2+1:]
cnt = 0
for i in range(n//2):
    if l[i] == l[n//2 - 1 - i]:
        cnt += 1
    if r[i] == r[n//2 - 1 - i]:
        cnt += 1
if cnt == n - 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
s = input().strip()

def is_kaibun(ss):
    return ss[: len(ss) // 2] == ss[len(ss) // 2 + 1:][:: -1]

if is_kaibun(s) and is_kaibun(s[:len(s) // 2]):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

#print(S[:int((n-1)/2)], S[:int((n-1)/2)][::-1])
if S[:int((n-1)/2)] == S[:int((n-1)/2)][::-1] and S[int((n+1)/2):]== S[int((n+1)/2):][::-1]:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
def check_kaibun(s):
    center_idx = len(s) // 2
    if s[:center_idx] == s[center_idx + 1 :]:
        return True
    else:
        return False

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=raw_input()
flag=0
s1=s[::-1]
# print s1
if s1!=s:
  print "NO"
  exit(0)
s1=s[0:(len(s)-1)/2]
s2=s1[::-1]
# print s1
if s1!=s2:
  print "NO"
  exit(0)
s1=s[(len(s)+3)/2-1::]
# print s1
s2=s1[::-1]
if s1!=s2:
  print "NO"
  exit(0)
print "YES"

Submission status: Wrong Answer

Solution code:
#gcdは3.4.3だとfractionsにある
from fractions import gcd
import math

from math import factorial as f

from math import ceil,floor,sqrt


import bisect
import re
import heapq


from copy import deepcopy
import itertools

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

yes = "Yes"
no = "No"

def main():
    s = list(input())
    n = len(s)
    srev = list(reversed(s))
    for i in range(n):
        if not s[n-1-i] == srev[i]:
            print(no)
            exit()
    for i in range((n-1)//2):
        if not s[i] == srev[i+1+(n-1)//2]:
            print(no)
            exit()
    for i in range((n-1)//2):
        if not srev[i] == s[i+1+(n-1)//2]:
            print(no)
            exit()
    print(yes)



main()

Submission status: Wrong Answer

Solution code:
s = input()

cnt = 1
l = len(s)
l1 = l//2
for i in range(l1):
  if s[i] != s[l-1-i]:
    cnt = 0

for i in range(l1//2):
  if s[i] != s[l1//2-1-i]:
    cnt = 0

for i in range(l1//2):
  if s[l1//2+1+i] != s[l1//2-1-i]:
    cnt = 0
if cnt == 0:
  print("No")
else:
  print("Yes")

Submission status: Wrong Answer

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

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

alen = len(a)
blen = len(b)

for i in range(alen):
    if a[i] != a[alen - i - 1]:
        print("No")
        exit()

for i in range(blen):
    if b[i] != b[blen - i - 1]:
        print("No")
        exit()

print("Yes")

Submission status: Wrong Answer

Solution code:
S = input()
first = S[:int((len(S)-1)/2)]
second = S[int((len(S)+3)/2-1):]
if first == ''.join(list(reversed(first))) and second == ''.join(list(reversed(second))):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
string = str(input())
N = len(string)
zenhan = string[:int((N-1)/2)]
kouhan = string[int((N-1)/2)+1:]

def IsKaibun(string):
    if string == string[::-1]:
        return True
    else:
        return False
      
if IsKaibun(zenhan) and IsKaibun(kouhan):
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
#  --*-coding:utf-8-*--


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

    return True


S = input()
N = len(S)

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

Submission status: Wrong Answer

Solution code:
import sys
S = input()
def is_palindrome(S):
  P = S[::-1]
  print(P)
  if S == P:
    return True
  return False
if is_palindrome(S):
  N = len(S)
  if is_palindrome(S[0:(N-1)//2]) and is_palindrome(S[(N+3)//2-1:N]):
    print('Yes')
    sys.exit(0)
print('No')

Submission status: Wrong Answer

Solution code:
def main():
    S = list(input())
    N = len(S)

    kaibun_check(S)
    S1 = S[0:(N-1)//2]
    kaibun_check(S1)
    S2 = S[(N+3)//2 + 1: -1]
    kaibun_check(S2)

    print('Yes')


def kaibun_check(L):
    L_ = list(L.__reversed__())
    for s, s_ in zip(L, L_):
        if s != s_:
            print('No')
            exit()


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# ABC159_B
s=input()
n=len(s)
n=n//2
f=''
e=''
f=s[:n]
e=s[-n:]
for i in range(n):
    if f[i]==f[-1-i] and e[i]==e[-i-1]:
        pass
    else:
        print('No')
        exit()
print('Yes')

Submission status: Wrong Answer

Solution code:
s = input()
s_r = s[::-1]
s_1 = s[:3]
s_1_r = s_1[::-1]
s_r_1 = s_r[:3]
s_r_1_r = s_r_1[::-1]
if s == s_r:
    if s_1 == s_1_r and s_r_1 == s_r_1_r:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
S = input()

N = len(S)

ng = False
for i in range(N):#First
  if S[i] != S[-i]:
    ng = True

for i in range(N//2):#Second
  if S[i] != S[ N // 2 - i - 1]:
    ng = True

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

Submission status: Wrong Answer

Solution code:
import sys
import os
import time
import collections
from collections import Counter, deque
import itertools
import math
import timeit
import random
from io import BytesIO, IOBase
 
#########################
# imgur.com/Pkt7iIf.png #
#########################
 
def sieve(n):
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r
 
def divs(n, start=1):
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors
 
def divn(n, primes):
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t
 
def flin(d, x, default=-1):
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return (default, default)
    else:
        return (left, right)
 
def ceil(n, k): return n // k + (n % k != 0)
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(map(int, input().split()))
def lcm(a, b): return abs(a * b) // math.gcd(a, b)
def prr(a, sep=' '): print(sep.join(map(str, a)))
def dd(): return collections.defaultdict(int)
def ddl(): return collections.defaultdict(list)
 
 
# 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")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
 
# endregion
'''for _ in range(ii()):
    n=ii()
    a=li()
    m,k,md=0,0,0
    mn,mx=10**9+1,-10**9-1
    for i in range(n-1):
        if a[i]!=-1 and a[i+1]!=-1:
            m=max(m,abs(a[i]-a[i+1]))
    for i in range(1,n-1):
        if a[i]==-1:
            if a[i+1]!=-1:
                mn=min(mn,a[i+1])
                mx=max(mx,a[i+1])
            if a[i-1]!=-1:
                mn=min(mn,a[i-1])
                mx=max(mx,a[i-1])
    if mn==10**9+1 and mx==-10**9-1:
        print(0,0,sep=' ')
    else:
        md=(mn+mx+1)//2
        m=max(abs(mx-md),abs(mn-md),m)
        print(m,md,sep=' ')'''

'''for _ in range(ii()):
    n,m=mi()
    tg=n//2
    n0=n-m
    total=(n*(n+1))//2
    res=0
    if n0<n:
        if m>=tg:
            res=total-n0
        else:
            i=tg-m
            if n&1:
                nn0=2*i+1
            else:
                nn0=2*i
            res=total-((nn0*(nn0+1))//2)-(n0-nn0)
            #print(nn0,n0-nn0)
    print(res)'''
#***************************************************************************************************************************


'''def solve():
    n=int(input())
    a=list(map(int,input().split()))
    diff=len(set(a))
    if diff==1: print (int((n*(n+1))/2))
    elif diff==n: print (1)
    else:
        i=j=ans=0
        ahead=True
        distinct={}
        while j<n:
            if ahead:
                distinct[a[j]]=distinct[a[j]]+1 if a[j] in distinct else 1
                if len(distinct)==diff:
                    ahead=False
                else:
                    j+=1
            else:
                ans+=n-j
                if distinct[a[i]]>1:
                    distinct[a[i]]-=1
                else:
                    distinct.pop(a[i])
                    j+=1
                    ahead=True
                i+=1
        print (ans)
 
solve()'''

#******************************************************************************************

'''s=input()
n=len(s)
i,cntl,cntg=0,0,0
res,fl,fg=0,0,0
while(i<n):
    if s[i]=='<':
        while(i<n and s[i]!='>'):
            fl=1
            cntl+=1
            i+=1
    else:
        while(i<n and s[i]!='<'):
            fg=1
            cntg+=1
            i+=1
    if fl==1 and fg==1:
        res+=max(cntl,cntg)
        cntl-=1
        cntg-=1
        res+=cntl*(cntl+1)//2
        res+=cntg*(cntg+1)//2
        fl,fg,cntl,cntg=0,0,0,0
if fl:
    res+=cntl*(cntl+1)//2
if fg:
    res+=cntg*(cntg+1)//2
print(res)'''


#********************************************************************************************************

def isPalindrome(s):
    return s==s[::-1]
s=input()
n=len(s)
f=0
if isPalindrome(s):
    f=1
else:
    f=0
if isPalindrome(s[:n//2]):
    f=1
else:
    f=0
if isPalindrome(s[(n+2)//2:]):
    f=1
else:
    f=0
if f==1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
from sys import stdin
def main():
    readline=stdin.readline
    S=readline().strip()
    N=len(S)
    M=N//2
    L=M//2

    if S[:M]==S[M+1:][::-1] and S[:L]==S[L+1:M][::-1] and S[M+1:M+1+L]==S[M+1+L+1:][::-1]:
        print("Yes")
    else:
        print("No")
if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    #from sys import stdin, setrecursionlimit
    #setrecursionlimit(10**9)
    #r = input()
    #n = int(input())
    #a, b = map(int, input().split())
    #s, y = input().split()
    #a = input().split()
    #a = list(map(int, input().split()))
    #a = [list(input().split()) for i in range(n)]
    #a = [int(input()) for i in range(n)]
    #a = [list(map(int, input().split())) for i in range(n)]
    #a = [int(s) - 1 for s in input().split()]
    #l=[int(input()) for _ in range(int(input()))]
    #res = 0
    s=list(input())
    n=len(s)
    l1=s[:(n-1)//2]
    l2=s[(n+3)//2-1:]
    if l1==l1[::-1] and l2==l2[::-1]:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


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


def check2(s):
    l = len(s) // 2
    if s[:l] != s[:l:-1]:
        return False
    return True


def check(s):
    l = len(s) // 2
    if s[:l] != s[:l:-1]:
        return False
    if check2(s[:l]) and check2(s[l+1:]):
        return  True
    return False


def main():
    s = input()
    if check(s):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()