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 = 0

be = int((N-1)/2)
af = int((N+3)/2-1)

for i in range(be):
  if S[i] != S[be-1-i]:
    flag = 1
    break
  
for i in range(af, N):
  if S[i] != S[N-1-i]:
    flag = 1
    break

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

Submission status: Accepted

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

x = int((N-1)/2) - 1
y = int((N+3)/2) - 1

S_lead = S[0: x + 1]
S_end = S[y : N+1]

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

Submission status: Accepted

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

for i in range(n):
    if s[i] != s[n - i - 1]:
        print("No")
        exit()
        
aa = math.floor((n - 1) / 2)
bb = math.ceil((n + 3) / 2)
a = s[0:aa]
b = s[bb - 1: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: Accepted

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

h = S[0:((N-1)//2)]
ah = S[((N+3)//2 -1):]

if h == ah:
    hh = h[0:len(h)//2]
    flg = True
    for i in range(len(hh)):
        if not hh[i] == h[-(i+1)]:
            flg = False
            break
    if flg:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
l = len(S)
flag = 0
half = l // 2

for i in range(l):
  if S[i] != S[l - 1 - i]:
    flag = 1
    
for i in range(half // 2):
  if S[i] != S[half - 1 - i]:
    flag = 1
    
for i in range(half // 2):
  if S[half + 1 + i] != S[l - 1 - i]:
    flag = 1
    
if flag == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
def main():
  s = input()
  n = len(s)
  first = s[:(n-1)//2]
  last = s[((n+3)//2)-1:]
  if first != last:
    print('No')
    exit(0)
  print('Yes')
  
def count_section_by_zero(data):
  count = 0
  flg = False
  start = 0
  for i, d in enumerate(data):
    if flg is False and d != 0:
      count += 1
      flg = True
      
    if d == 0:
      flg = False
  return count

def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

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

def input_list_str():
  return map(str, input().split())

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

# 2で割り切れる回数
def divide_two(arg):
  c = 0
  while True:
    if c >= 2:
      break
    if arg % 2 != 0:
      break
    arg //= 2
    c += 1
  return c

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

import math
import fractions
import collections
from functools import reduce
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict
from collections import deque
from string import ascii_uppercase
import sys, bisect, math, heapq

stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

S = read_str()

def solve():
    ans = 0
    N = len(S)
    s1 = S[0: (N - 1) // 2]
    s2 = S[(N + 3) // 2 - 1 :N]
    if S != S[::-1]:
        return 'No'
    if s1 != s1[::-1]:
        return 'No'
    if s2[::-1] != s2[::-1]:
        return 'No'
    return 'Yes'

if __name__ == "__main__":
    print(solve())

Submission status: Accepted

Solution code:
S=str(input())
N=len(S)
T=S[0:int((N-1)/2)]
U=S[int((N+1)/2):N]
B=0
for i in range(len(T)):
 if T[i]==T[len(T)-1-i]:
  B+=1
if B==len(T) and T==U:
 print("Yes")
else:
 print("No")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

s = S[::-1]
X=S[:int((N-1)/2)]
x = X[::-1]
Y=S[int((N+3)/2)-1:]
y = Y[::-1]

if S==s and X==x and Y==y:
  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:]

ans = 'Yes'

if s != s[::-1]:
    ans = 'No'
if s1 != s1[::-1]:
    ans = 'No'
if s2 != s2[::-1]:
    ans = 'No'

print(ans)

Submission status: Accepted

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


s = input()
n = len(s)
flag = palindrome(s) and palindrome(
    s[0:((n - 1) // 2)]) and palindrome(s[(n + 3) // 2 - 1:])

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

Submission status: Accepted

Solution code:
stri = list(input())
hantei = 0
hant = 0
han = 0
N = len(stri)

for i in range(int((N-1)/2)):
    if stri[i] != stri[N-i-1]:
        hantei = 1
        break

stri1 = stri[:int((N-1)/2)]
stri2 = stri[int((N-1)/2)+1:]


for i in range(len(stri1)):
    if stri1[i] != stri1[len(stri1)-i-1]:
        hant = 1
        break

for i in range(len(stri2)):
    if stri2[i] != stri2[len(stri2)-i-1]:
        han = 1
        break

if hantei == 0 and hant == 0 and han == 0:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
one = s + s
two = s[:(n-1)//2] 
theree = s[(n+3)//2 -1:] 

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

Submission status: Accepted

Solution code:
import sys
import os

MOD = 10 ** 9 + 7


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

    S = list(sys.stdin.buffer.readline().decode().rstrip())
    M = S[0: (len(S) - 1) // 2]
    U = S[(len(S) + 2) // 2:]
    print('Yes' if S == S[::-1] and M == M[::-1] and U == U[::-1] else 'No')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#a,b = [int(x) for x in input().split()]
s = input()
sl=list(s)
N = len(sl)
k = 0
for i in range(int((N-1)/2)):
  if sl[i] != sl[N-i-1]:
    k = 1
    break
if k == 0:
  for i in range(int((N-1)/4)):
    if sl[i] != sl[int((N-1)/2-i-1)]:
      k = 1
      break
if k == 0:
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

if s != s[::-1]:
    print('No')
    exit()

s2 = s[:int((n-1)/2)]
if s2 != s2[::-1]:
    print('No')
    exit()

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

print('Yes')

Submission status: Accepted

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

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

ans = 0
ans += St_Pal(s1)
ans += St_Pal(s2)
ans += St_Pal(s3)

if ans == 3:
    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[::-1]==s and s1[::-1]==s1 and s2[::-1]==s2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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


b=int((len(s)-1)/2)
c=int((len(s)+3)/2)
mae=s[:b]
ato=s[c-1:]
if kaibun(s) and kaibun(mae) and kaibun(ato) :
  print ('Yes')
else :
  print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# cook your dish here
from sys import stdin, stdout
import math
from itertools import permutations, combinations
from collections import defaultdict
from bisect import bisect_left

def L():
    return list(map(int, stdin.readline().split()))

def In():
    return map(int, stdin.readline().split())

def I():
    return int(stdin.readline())

P = 1000000007
s = input()
n = len(s)
if len(s)%2 == 0:
    print("No")
else:
    if s[0:(n-1)//2] == s[(n+1)//2:]:
        st1 = (s[0:(n-1)//2:-1])
        if st1 == st1[::-1]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def no():
    print('No')
    exit()

def main():
    s=list(input())
    n=len(s)
    s1=s[:n//2]
    s2=s[(n+3)//2-1:]
    for i in range(n//2):
        if s1[i]!=s2[i]: no()
    print('Yes')
            



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
n = len(s)
a = (n-1)//2
b = (n+3)//2

c = s[0:a]
d = c[::-1]
e = s[b-1:n]
f = e[::-1]

t = s[::-1]

if c==d and e==f and s==t:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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)
N4 = int(N3//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: Accepted

Solution code:
import sys

S = input()

# S = 'akasaka'

N = len(S)

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

sub_S = S[:int((N - 1)/2)]
sub_S_rev = S[int((N + 3)/2)-1:]
if sub_S != sub_S_rev:
    print('No')
    sys.exit(0)

print('Yes')

Submission status: Accepted

Solution code:
S = input()
left = ((len(S) - 1) // 2)
right = ((len(S) + 3) // 2) - 1
l_s = S[0:left]
r_s = S[right:len(S)]
if(S == S[::-1] and l_s == l_s[::-1] and r_s == r_s[::-1]):
  print("Yes")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
s = list(input())
n = len(s)
t = list(reversed(s))
if s != t:
    print("No")
    sys.exit()
else:
    u = s[:(n-1)//2]
    v = s[(n+1)//2:]
    w = list(reversed(u))
    x = list(reversed(v))
    if u == w and v == x:
        print("Yes")
    else:
        print("No")

Submission status: Accepted

Solution code:
s=input()#sは奇数
answer="Yes"
len=len(s)
for i in range(int((len-1)/2)):
    if s[i]!=s[len-i-1]:
        answer="No"
for j in range(int((len-1)//4)):
    if s[j]!=s[int((len-1)/2-j-1)]:
        answer="No"
    if s[int((len+1)/2+j)]!=s[len-j-1]:
        answer="No"
print(answer)

Submission status: Accepted

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


def f1(S):
    N = len(S)
    subset3 = S[0:(N - 2) // 2 + 1]
    subset4 = S[(N + 2) // 2:]
    return subset3, subset4


subset1, subset2 = f1(S)
_subset2 = ''.join(list(reversed(subset2)))
if subset1 != _subset2:
    print('No')
    exit()

if (N - 1) % 4 == 0:
    # print('subset1 2', subset1, subset2)
    subset3 = subset1[:((N - 1) // 4)]
    subset4 = subset1[((N - 1) // 4):]
    _subset4 = ''.join(list(reversed(subset4)))
    # print('subset3 4', subset3, subset4)
    subset5 = subset2[:((N - 1) // 4)]
    subset6 = subset2[((N - 1) // 4):]
    _subset6 = ''.join(list(reversed(subset6)))
    # print('subset5 6', subset5, subset6)
else:
    subset3, subset4 = f1(subset1)
    _subset4 = ''.join(list(reversed(subset4)))
    subset5, subset6 = f1(subset2)
    _subset6 = ''.join(list(reversed(subset6)))
if subset3 != _subset4:
    print('No')
    exit()
if subset5 != _subset6:
    print('No')
    exit()
print('Yes')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def rev(s1):
	i = 0
	j = len(s1) - 1
	while i < j:
		if s1[i] != s1[j]:
			return 0
		i+=1
		j-=1
	return 1

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

Submission status: Accepted

Solution code:
#B - String Palindrome
S = input()

for i in range((len(S)-1)//2):
    if S[i] == S[i+(len(S)+3)//2-1]:
        pass
    else:
        print("No")
        exit()
print("Yes")

Submission status: Accepted

Solution code:
def is_kaibun(string):
    return string == string[::-1]

def clip1(string, N):
    end = int((N-1)/2)
    return string[:end]

def clip2(string, N):
    start = int((N+3)/2)-1
    end = N
    return string[start:end]


s1 = input()
N = len(s1)

s2, s3 = clip1(s1, N), clip2(s1, N)
#  print(s2, "  ", s3)

#  print(is_kaibun(s1))
#  print(is_kaibun(s2))
#  print(is_kaibun(s3))

ans = 'Yes' if is_kaibun(s1) and is_kaibun(s2) and is_kaibun(s3) else 'No'
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

N = len(S)

# print(S[:int((N-1)/2)])
# print(S[int((N+2)/2):])

rev_S = S[::-1]
a = S[:int((N-1)/2)]
rev_a = a[::-1]
b = S[int((N+2)/2):]
rev_b = b[::-1]

if S==rev_S and a==rev_a and b==rev_b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,itertools,math,string
def I(): return int(input())
def S(): return input()
def LI(): return list(map(int,input().split()))
def LS(): return list(input().split())
##################################################
S = S()
N = len(S)
S1 = S == S[::-1]
S2 = S[:(N-1)//2] == S[:(N-1)//2][::-1]
S3 = S[(N+3)//2-1:] == S[(N+3)//2-1:][::-1]
print('Yes' if S1 and S2 and S3 else 'No')

Submission status: Accepted

Solution code:
s = input()
m = len(s) // 2
print('NYoe s'[s[:m] == s[m - 1::-1] == s[m + 1:]::2])

Submission status: Accepted

Solution code:
s=input()
nagasa=len(s)
liss=list(s)
revs=list(reversed(s))
zen=list(s[:(nagasa-1)//2])
revzen=list(reversed(zen))
kou=list(s[(nagasa+2)//2:])
revkou=list(reversed(kou))
if liss==revs and zen == revzen and kou== revkou:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=str(input())
P=S
for i in range(len(P)//2):
  if P[i]!=P[len(P)-1-i]:
    print('No')
    exit()
    
for i in range(len(P)//2):
  if P[i]!=P[len(P)-1-i]:
    print('No')
    exit()

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

Submission status: Accepted

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

    left = s[:len(s) // 2]
    right = s[len(s) // 2 + (1 if len(s) % 2 != 0 else 0):]
    return left == left[::-1] and right == right[::-1]


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

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

Submission status: Accepted

Solution code:
s = input()

n = len(s)

s_head= s[:int((n-1)/2)]
s_tail= s[int((n+3)/2)-1:]

# print(s_head)
# print(s_tail)
# print(s_tail)
s_tailr = ''.join(list(reversed(s_tail)))
if s_head == s_tail  and s_head == s_tailr:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

for i in range(n // 2):
    if s[i] != s[-i-1]:
        print('No')
        exit()
t = s[0:(n-1)//2]
n = len(t)
#print(t)
for i in range(n//2):
    if t[i] != t[-i-1]:
        print('No')
        exit()
t = s[(len(s)+3)//2-1:len(s)]
n = len(t)
#print(t)
for i in range(n//2):
    if t[i] != t[-i-1]:
        print('No')
        exit()
print('Yes')

Submission status: Accepted

Solution code:
s=input()
n0=len(s)
n1=(n0-1)//2
n2=(n0+3)//2

sr=s[::-1]
if s!=sr:
    print("No")
    exit()
    
s1=s[:n1]
s1r=s1[::-1]
if s1!=s1r:
    print("No")
    exit()

s2=s[n2-1:]
s2r=s2[::-1]
if s2!=s2r:
    print("No")
    exit()
    
print("Yes")

Submission status: Accepted

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

S = input()
N = len(S)

sta = (N - 1) // 2
end = (N + 3) //2

if is_kaibun(S):
    if is_kaibun(S[0:sta]):
        if is_kaibun(S[end - 1:]):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

l = len(S)
end1 = round((l-1)/2)
end2 = round((l+3)/2)

if(S[0:end1] == S[end2-1:]):
        print("Yes")
else:
        print("No")

Submission status: Accepted

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):
        print('No')
    elif 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: Accepted

Solution code:
def ispalin(s):
    if(s==s[::-1]):
        return True
    else:
        return False
s=input()
n=len(s)
if(ispalin(s)):
    p=(n-1)//2
    q=(n+3)//2
    #print(s[:p],s[q-1:])
    if(ispalin(s[:p])):
        if(ispalin(s[q-1:])):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

s = str(input())

s_list = list(s)
len_slist = len(s_list)

s_list_a = s_list[0: (len_slist-1)//2]
s_list_b = s_list[(len_slist+3)//2 - 1:]

s_list_rev = deepcopy(s_list)
s_list_rev.reverse()

s_list_a_rev = deepcopy(s_list_a)
s_list_a_rev.reverse()

s_list_b_rev = deepcopy(s_list_b)
s_list_b_rev.reverse()

flg = s_list == s_list_rev
flg_a = s_list_a == s_list_a_rev
flg_b = s_list_b == s_list_b_rev

if flg and flg_a and flg_b:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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[::-1]:
        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: Accepted

Solution code:
import sys
c = input()
n = len(c)
for i in range(int((n-1)/2)):
    if c[i] != c[-(i+1)]:
        print("No") 
        sys.exit()
temp = c[:int((n-1)/2)]
l_temp = len(temp)
for i in range(int((l_temp/2))):
    if temp[i] != temp[-(i+1)]:
        print("No") 
        sys.exit()
temp = c[int((n+3)/2)-1:]
l_temp = len(temp)
for i in range(int((l_temp/2))):
    if temp[i] != temp[-(i+1)]:
        print("No") 
        sys.exit()
print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = [_ for _ in input()]
n = len(s)

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


def kaibun(ss):
    if ss[::-1] == ss:
        return True
    return False

if kaibun(s) and kaibun(s0) and kaibun(s1):
    print('Yes')
    exit(0)
print('No')

Submission status: Accepted

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

def is_tsuyoi(s):
    n = len(s)
    if not is_kaibun(s):
        return False
    if not is_kaibun(s[:(n-1)//2]):
        return False
    if not is_kaibun(s[(n+3)//2-1:]):
        return False

    return True

S = input()

print('Yes' if is_tsuyoi(S) else 'No')

Submission status: Accepted

Solution code:
#!/user/bin/env python3
# -*- conding: utf-8 -*-

def main():
    S = input()
    N = len(S)
    flag = 'No'

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

    if S == S[::-1]:
        if s1 == s1[::-1]:
            if s2 == s2[::-1]:
                flag = 'Yes'
    
    print(flag)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == "__main__":
    s = input()
    print(check(s))

Submission status: Accepted

Solution code:
s= input()

s_r = s[::-1]
N = len(s)
s_2 = s[:int((N-1)/2)]
s_3 = s[int((N+1)/2):]

if ( (s == s_r) & (s_2 ==s_2[::-1]) &(s_3 ==s_3[::-1])):
  print('Yes')
else :
  print('No')

Submission status: Accepted

Solution code:
S = list(input())

N = len(S)
N1 = int((N - 1) / 2)
N2 = int((N + 3) / 2)
S0 = list(reversed(S))
S1 = list(reversed(S[:N1]))
S2 = list(reversed(S[N2-1:]))

if S == S0 and S[:N1] == S1 and S[N2-1:] == S2:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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) and isPalindrome(s[:n//2]) and isPalindrome(s[(n+2)//2:]):
    f=1
else:
    f=0
if f==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:]
if a==a[::-1] and b==b[::-1] and s==s[::-1]:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
S = input()

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

if (ispalindrome(S) == 0):
    print("No")
    exit()

length = len(S)

if (ispalindrome(S[0:int((length - 1) / 2)]) == 0):
    print("No")
    exit()

part = length - (int((length + 3) / 2) - 1)

if (ispalindrome(S[int((length + 3) / 2) - 1:part]) == 0):
    print("No")
    exit()

print("Yes")