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:
def chk(i,j,f,s):
    while (j > i and f == 0):
        if s[i] != s[j]:
            f = 1
            break

        j = j-1
        i = i+1

    return f


s = input()
l = len(s)
lh = (l)//2
j = l-1
i = 0
f = 0
r = chk(i,j,f,s)
if r == 1:
    print("No")
    exit()

s1 = s[0:lh]
#lh1 = len(s1)//2
j = len(s1)-1
i = 0
f = 0
r = chk(i,j,f,s1)
if r == 1:
    print("No")
    exit()

s2 = s[lh+1:]


#lh2 = len(s2)//2
j = len(s2)-1
i = 0
f = 0
r = chk(i,j,f,s2)
if r == 1:
    print("No")
    exit()

print("Yes")

Submission status: Accepted

Solution code:
S = str(input())
S_1 = []
for i in range((len(S)-1)//2):
    S_1.append(S[i])
S_2 = []
for j in range(len(S) - (len(S)+3)//2 +1):
    S_2.append(S[(len(S)+3)//2 - 1 + j])
s = []
for k in range(len(S)):
    s.append(S[k])
if list(s) == list(reversed(s)):
    if list(S_1) == list(reversed(S_1)):
        if S_2 == list(reversed(S_2)):
            print('Yes')
            exit()
print('No')

Submission status: Accepted

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

else:
    print("No")

Submission status: Accepted

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

s_inv = s[::-1]

t = s[0:(n-1)//2]
t_inv = t[::-1]

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

if s==s_inv and t == t_inv and u == u_inv:
    print('Yes')
else:
    print("No")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
n = len(S)
S1 = S[0:int((n-1)/2)]
S2 = S[int((n+3)/2-1):n]

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

Submission status: Accepted

Solution code:
s = input()

n = len(s)

palin = lambda s: s == s[::-1]
f = (n-1)//2 
i = (n+3)//2

if palin(s[0:f]) and palin(s[i-1:n]) and palin(s):
	print("Yes")
else:
	print("No")

Submission status: Accepted

Solution code:
S = input()
N=len(S)
S1 = S[0:int((N-1)/2)]
S2 = S[int((N+3)/2)-1:N]
S_r = ''.join(list(reversed(S)))
S1_r = ''.join(list(reversed(S1)))
S2_r = ''.join(list(reversed(S2)))
if S==S_r and S1==S1_r and S2==S2_r:
    print('Yes')
else:
    print('No')

Submission status: Accepted

Solution code:
def pal(t):
  return t == t[::-1];


s = input();
f = pal(s) and pal(s[0:len(s)//2:]) and pal(s[(len(s)//2 + 1)::]);
#f = pal(s);
if f == True:
  print("Yes");
else:
  print("No");

Submission status: Accepted

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

s = input()
n = len(s)
s_left = s[0:int((n-1)/2)]
s_right = s[int((n+1)/2):]

if palindromeJ(s) and palindromeJ(s_left) and palindromeJ(s_right):
    print("Yes")
else:           
    print("No")

Submission status: Accepted

Solution code:
S = str(input())

def rot(S):
    size = len(S)
    for i in range(size // 2):
        if S[i] != S[-(i + 1)]: return False
    return True

if not rot(S):
    print("No")
elif not rot(S[0 : len(S) // 2]):
    print("No")
else:
    print("Yes")

Submission status: Accepted

Solution code:
s=str(input())
n=len(s)
k=s[0:(n-1)//2]
k1=s[(n+3)//2-1:n]

if n%2!=0 and k=="".join(reversed(k)) and k1=="".join(reversed(k1)) and s=="".join(reversed(s)):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input();print(' YNeos'[s[:len(s)//2]in s[2:]::2])

Submission status: Accepted

Solution code:
s = list(input())

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

ichi = list(reversed(s))
ni = s[0:a]
san = s[b-1:n+1]

rni = list(reversed(ni))
rsan = list(reversed(san))

if s == ichi and ni == rni and san == rsan:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input();n=len(s)//2;print('YNeos'[s!=s[::-1]or s[:n]!=s[-n:]::2])

Submission status: Accepted

Solution code:
S = []
S_reverse = []
S_first = []
S_first_reverse = []
S_last = []
S_last_reverse = []

S = list(input())
S_reverse = S.copy()
S_reverse.reverse()
S_first = S[:len(S)//2]
S_last = S[(len(S)+1)//2:]
S_first_reverse = S_first.copy()
S_first_reverse.reverse()
S_last_reverse = S_last.copy()
S_last_reverse.reverse()


if S != S_reverse:
    print("No")
elif S_first == S_first_reverse and S_last == S_last_reverse:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
s=input();n=len(s)//2;print('YNeos'[s[:n]!=s[-n:]::2])

Submission status: Accepted

Solution code:
s=input();n=len(s)//2;print("YNeos"[s[:n]!=s[-n:]::2])

Submission status: Accepted

Solution code:
s=input()
n=len(s)//2
print("YNeos"[s[:n]!=s[-n:]::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
slist = list(s)

def rev(some):
    return list(reversed(some))
    
def check(slist):
    n = len(slist)
    if rev(slist) != slist:
        return "No"
    else:
        first_half = slist[0:int((n-1)/2)]
        second_half = slist[int(((n+3)/2))-1:(n+1)]
        if first_half != rev(first_half):
            return "No"
        else:
            if second_half != rev(second_half):
                return "No"
            return 'Yes'

print(check(slist))

Submission status: Accepted

Solution code:
s = input()
def isPalindrome(string):
    return string == string[::-1]
if isPalindrome(s) and isPalindrome(s[0:len(s)//2]):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

def circular(string):
    return string == string[::-1]
if circular(s) and circular(a):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

def circular(string):
    return string == "".join(reversed(list(string)))

if circular(s) and circular(a):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

def circular(string):
    return string == "".join(reversed(list(string)))

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
a = s[:n//2]
b = s[n//2+1:]
def circular(string):
    return string == "".join(reversed(list(string)))

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

Submission status: Accepted

Solution code:
def kaibun(string):
  return string == "".join(reversed(list(string)))

s = input()
l = len(s)
t, u = s[:l//2], s[l//2+1:]

if kaibun(s) and kaibun(t) and kaibun(u):
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
str = input("")
n = len(str)
BOOL = True
for i in range(int((n + 1) / 2)):
    BOOL = BOOL and str[i] == str[n - 1 - i]

for i in range(int((n - 1) / 2)):
    BOOL = BOOL and str[i] == str[int((n - 1) / 2 - 1 - i)]

for i in range(int((n - 1) / 2)):
    BOOL = BOOL and str[int((n + 3) / 2 - 1 + i)] == str[n - 1 - i]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()


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


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

Submission status: Accepted

Solution code:
S = input()
N = len(S)
n = int((N-1)/2)
S_r = S[::-1]

S1 = S[0:n]
N1 = len(S1)
n1 = int((N1-1)/2)
if n1 < 1:
  n1 = 1
S1_r = S1[::-1]

S2 = S[int((N+3)/2)-1:N]
N2 = len(S2)
n2 = int((N2-1)/2)
if n2 < 1:
  n2 = 1
S2_r = S2[::-1]

if S[0:n]==S_r[0:n] and S1[0:n1]==S1_r[0:n1] and S2[0:n2]==S2_r[0:n2]:
  print('Yes')
else:
  print('No')

Submission status: Accepted

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

k=(n-1)//2
l=(n+3)//2
if s==s[::-1]:
    if(s[:k]==s[:k][::-1]):#s[:k][::-1]0からkまでスライスして逆順に並べる
        if(s[l-1:n]==s[l-1:n][::-1]):
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

Submission status: Accepted

Solution code:
S = input()
N = len(S)
x = int((N - 1) / 2)
y = int((N + 3) / 2) - 1

word = S[0:x]
head = S[0:x]
tail = S[y:N]
reverse = word[::-1]

if tail == word and tail == reverse:
  print('Yes')
else:
  print('No')

Submission status: Accepted

Solution code:
S = input()

front = S[0:len(S)//2]
back = S[(len(S)+3) // 2-1:len(S)]

if front == back[::-1] and front[0] == front[-1] and back[0] == back[-1]:
    print("Yes")

else:
    print("No")

Submission status: Accepted

Solution code:
S = input()

def isPal(w):
    return w == w[::-1]

def isStrongPal(w):
    n = len(w)
    return isPal(w) and isPal(w[:n//2])

if isStrongPal(S):
    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[n-1-i]):
    print("No")
    quit()

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

print("Yes")

Submission status: Accepted

Solution code:
def knsu(S):
    N = len(S)
    F = True
    for i in range(N):
        J = N - 1 - i
        if S[i] == S[J]:
            pass
        else:
            F = False
            break

    return F


S = input()
N = len(S)
f1 = knsu(S[:N//2])
f2 = knsu(S[N//2+1:])
f3 = knsu(S)
if f1 and f2 and f3:
    print("Yes")
else:
    print("No")


# if F:
#     print("Yes")
# else:
#     print("No")
# if S[2] == S[3] and S[4] == S[5]:
#      print("Yes")
# else:
#     print("No")
# # coffee

Submission status: Accepted

Solution code:
def judge_kaibun(text):
    if len(text) % 2 == 0:
        if text[:len(text)//2] == text[len(text)//2:][::-1]:
            return True
        else:
            return False
    else:
        if text[:len(text)//2] == text[len(text)//2+1:][::-1]:
            return True
        else:
            return False


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

Submission status: Accepted

Solution code:
s=input();print('YNeos'[s.count(s[:len(s)//2])<2::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

get = input()
if get[:int((len(get)-1)/2)] == get[int(((len(get)+3)/2)-1):]:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input().rstrip()
x=list(s)
if len(x)%2!=0:
  C=list(s)
  C.reverse();
  if(C!=x):
    print("No")
  else:
    A=(len(x)-1)//2;
    B=x[0:A];
    A=(len(x)+3)//2;
    C=x[A-1:len(x)]
    D=list(B)
    E=list(C)
    D.reverse();
    E.reverse();
    if(B==D and E==C):
      print("Yes")
    else:
      print("No")
else:
  print("No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
## coding: UTF-8

S = input()

#S_r = S[::-1]
#print(S_r)

N = len(S)

def hantei(s):
    #回文かどうかの判定
    if(s == s[::-1]):
        return 'OK'
    else:
        return 'NG'

#print(hantei(S))

answer = 'Yes'

#Sは回文である
if(hantei(S) == 'NG'):
    answer = 'No'

#前半は回文である
p = int((N-1) / 2)
#print(p)
#print(S[:p])
if(hantei(S[:p]) == 'NG'):
    answer = 'No'

#後半は回文である
q = int((N+3) / 2)
#print(S[q-1:])
if(hantei(S[q-1:]) == 'NG'):
    answer = 'No'

print(answer)

Submission status: Accepted

Solution code:
s = input()

mid = int(len(s) / 2)
flg = True

for i in range(mid):
    if s[i] is not s[-i-1]:
        flg = False

for i in range(int((len(s) - 1) / 2)):
    if s[i] is not s[int((len(s) - 1) / 2)-i-1]:
        flg = False

for i in range(int((len(s) + 3) / 2), len(s)):
    if s[i] is not s[-i-1]:
        flg = False

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

Submission status: Accepted

Solution code:
S = input()
a = S[:len(S)//2]
b = S[len(S)//2+1:]
ans = 'Yes'
for i in range(len(a)//2):
    if a[i] != a[len(a)-i-1]:
        ans = 'No'
        break
for i in range(len(b)//2):
    if b[i] != b[len(b)-i-1]:
        ans = 'No'
        break
for i in range(len(S)):
    if S[i] != S[len(S)-i-1]:
        ans = 'No'
        break
print(ans)

Submission status: Accepted

Solution code:
# 初期入力
S = input()

# Sを前半ー中心ー後半に分ける
S_mae = ""
S_mae_gyaku = ""
S_usiro =""
S_usiro_gyaku =""
S_tyusin_num =0
if len(S) % 2 ==1:
    S_tyusin_num =(len(S) )//2
    S_mae =S[:S_tyusin_num]
    S_mae_gyaku = S_mae[::-1]
    S_usiro = S[(-1)*S_tyusin_num:]
    S_usiro_gyaku = S_usiro[::-1]
    if S_mae == S_mae_gyaku and S_usiro == S_usiro_gyaku and S_mae == S_usiro: 
        print("Yes") # 前半だけで回文→S_mae == S_mae_gyaku
    else:
        print("No")

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]

s = [i for i in input()]
l = len(s)
a = s[:int((l-1)/2)]
b = s[int((l+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()
mid = len(S)//2 + 1
first = S[0:mid-1]
last = S[mid:]
first_ = ''.join(list(reversed(first))) 
last_ = ''.join(list(reversed(last))) 
a = ((first_ == first) and (last == last_) and (first == last_))
if a:
  print("Yes")
else:
  print("No")

Submission status: Accepted

Solution code:
s = input()
n = len(s)
s_half = s[:(n-1)//2]
s_half2 = s[(n-1)//2 +1:]
# print(s_half,s_half2)

if n%2 ==1:
    if s == s[::-1]:
        if s_half == s_half[::-1] and s_half2 == s_half[::-1]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')

Submission status: Accepted

Solution code:
s = input()

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

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

Submission status: Accepted

Solution code:
s = input()
def check(s):
    if s!=s[::-1]:
        return False
    t = s[:(len(s)-1)//2]
    if t!=t[::-1]:
        return False
    l = s[(len(s)+3)//2-1:]
    if l!=l[::-1]:
        return False
    return True
if check(s):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

def gg1(T):
    t=T[::-1]
    if T==t:
        a=0
        return a
    else:
        a=1
        return a

def gg2(R):
    r=(N-1)/2
    r=int(r)
    R1=R[:r]
    R2=R1[::-1]
    if R1==R2:
        b=0
        return b
    else:
        b=1
        return b

def gg3(Q):
    q=(N+3)/2-1
    q=int(q)
    Q1=Q[q:N+1]
    Q2=Q1[::-1]
    if Q1==Q2:
        c=0
        return c
    else:
        c=1
        return c

d=gg1(S)+gg2(S)+gg3(S)
if d==0:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
sa = s[:(len(s)-1)//2]

s_rev = s[::-1]
sa_rev = sa[::-1]

if s==s_rev and sa==sa_rev:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(string):
    n = len(string)
    pre, post = string[:(n - 1) // 2], string[(n + 3) // 2 - 1:]
    return "Yes" if string == string[::-1] and pre == pre[::-1] and post == post[::-1] else "No"


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Submission status: Accepted

Solution code:
str1 = input()
n = len(str1)
m = int((n-1)/2)
o = int((n+3)/2)
str2 = str1[:m]
str3 = str1[(o-1):n]
if str1 != str1[::-1]:
	print("No")
else:
    if str2 != str2[::-1]:
	    print("No")
    else:   
        if str3 != str3[::-1]:
            print("No")
        else:
            print("Yes")

Submission status: Accepted

Solution code:
S = list(input())
S_len = len(S)
S_reverse = list(S[::-1])

ans = 'Yes'

# 条件1 Sは回文である
if S == S_reverse:
    pass
else:
    ans = 'No'

# 条件2
S_2 = S[0:(S_len - 1) // 2]
S_2_reverse = S_2[::-1]
if S_2 == S_2_reverse:
    pass
else:
    ans = 'No'

# 条件3
S_3 = S[(S_len + 3) // 2 - 1:]
S_3_reverse = S_3[::-1]
if S_3 == S_3_reverse:
    pass
else:
    ans = 'No'
 
print(ans)

Submission status: Accepted

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

# 入力はstringで入る．
# intにしたければ int(input())
# floatで受け取ると 1.0 になる．

# 入力 : S
S = input()

N = len(S)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
s = input()

n = len(s)

def is_kaibun(s):
    n = len(s)
    h = s[0:math.ceil((n-1)/2)]
    t =  s[(n+3)//2-1:n]
    #print(h,t)
    return h == t[::-1]

h = s[0:(n-1)//2]
t =  s[(n+3)//2-1:n]

if is_kaibun(s) and is_kaibun(h) and is_kaibun(t):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
def iskai(tS):
    test = list(tS)
    testr = reversed(test)
    for i, j in zip(test, testr):
        if i != j:
            return False
            break
    else:
        return True
        


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

S = input()

N = len(S)

def check_pai(s):
    reversed_s = s[::-1]
    return s == reversed_s

lS = S[:(N-1)//2]
rS = S[(N+1)//2:]

if check_pai(S) and check_pai(lS) and check_pai(rS):
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:

def is_palindrom(s, start=0, end=None):
    if end is None:
        end = len(s) - 1
    n = len(s[start:end+1])
    for i in range(n//2):
        if s[start+i] != s[end - i]:
            return False
    return True

def is_strong_palindrom(s):
    n = len(s)
    if not is_palindrom(s):
        print("No")
    elif not is_palindrom(s, 0, (n-1)//2 - 1):
        print("No")
    elif not is_palindrom(s, (n+3)//2 -1, n-1):
        print("No")
    else:
        print("Yes")
        
line = input()
is_strong_palindrom(line)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
sb = S[:(len(S) - 1) // 2]
sc = S[(len(S) + 3) //2 -1:]
a = S == "".join(reversed(S))
b = sb == "".join(reversed(sb))
c = sc == "".join(reversed(sc))
print("Yes" if a and b and c == True else "No")

Submission status: Accepted

Solution code:
s=input()
ans=1
n=len(s)
for i in range(len(s)//2):
  if s[i]!=s[len(s)-1-i]:
    ans=0
s1=s[:(n-1)//2]
for i in range(len(s1)//2):
  if s1[i]!=s1[len(s1)-1-i]:
    ans=0
s2=s[(n+3)//2-1:]
for i in range(len(s2)//2):
  if s2[i]!=s2[len(s2)-1-i]:
    ans=0

print("YNeos"[1-ans::2])

Submission status: Accepted

Solution code:
S = input()
N = len(S)
def is_pali(s):
    for ind, i in enumerate(s[:len(s)//2]):
        if(i==s[-ind-1]):
            continue
        else:
            return False
    return True

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

Submission status: Accepted

Solution code:
def check(s):
    if len(s) % 2 == 0:
        L = len(s)//2
        head=s[:L]
        tale=s[L:]
    else:
        L = (len(s)-1)//2
        head = s[:L]
        tale = s[L+1:]
    if head == tale[::-1]:
        return True
    return False
s = input()
if not check(s):
    print("No")
elif not check(s[:(len(s)-1)//2]):
    print("No")
elif not check(s[(len(s)+3)//2-1:]):
    print("No")
else:
    print("Yes")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
if s!=s[::-1]:
  print("No")
  exit()
n=len(s)
chk_s=s[0:(n-1)//2]
if chk_s!=chk_s[::-1]:
  print("No")
  exit()
chk_s=s[(n+3)//2-1:]
if chk_s!=chk_s[::-1]:
  print("No")
  exit()
print("Yes")

Submission status: Accepted

Solution code:
S1 = input()
N1 = len(S1)
S2 = S1[:(N1-1)//2]
S3 = S1[(N1+3)-1//2:]
N2 = len(S2)
N3 = len(S3)
flag1 = True
flag2 = True
flag3 = True

for i in range(N1//2):
    if S1[i] != S1[-1-i]:
        flag1 = False
        break

for i in range(N2//2):
    if S2[i] != S2[-1-i]:
        flag2 = False
        break

for i in range(N3//2):
    if S3[i] != S3[-1-i]:
        flag3 = False
        break

print("Yes" if flag1 and flag2 and flag3 else "No")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
N2=((int(len(S))//2))
SS=S[0:N2]
A=0
B=-1

while SS[A]==SS[B]:
    A+=1
    B-=1
    if A>int(len(SS)//2):
        break

X=tuple(SS)
Y=tuple(S[N2+1:])
if A!=0 and X==Y:
    print("Yes")
else:
    print("No")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
S = input()
ans = True
def isP(s):
    return s == s[::-1]

if not isP(S):
    ans = False
if not isP(S[:(len(S)//2)]):
    ans = False

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

Submission status: Accepted

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

def isKaibun(s):
    i = 0
    l = len(s)
    flag = 1
    while 1:
        if s[i]==s[l-1-i]:
            i+=1
        else:
            flag=0
            break
        if l-1-i<i:
            break
    return flag

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

Submission status: Accepted

Solution code:
import sys

s = input()
revs = ''.join(list(reversed(s)))
n = len(s)

if s == revs:
    revs = ''.join(list(reversed(s[:(n)//2])))
    if s[:(n)//2] == revs:
        revs = ''.join(list(reversed(s[(n+2)//2:])))
        if s[(n+2)//2:] == revs:
            print("Yes")
            sys.exit()
print("No")

Submission status: Accepted

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

Submission status: Accepted

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

s0 = list(reversed(s))
s1 = list(reversed(s[:(n-1)//2]))
s2 = list(reversed(s[(n+1)//2:]))
if s == s0 and s[:(n-1)//2] == s1 and  s[(n+1)//2:] == s2:
    print('Yes')

else:
    print('No')

Submission status: Accepted

Solution code:
S=list(input())
N=len(S)
for i in range(N//2):
    if S[i]==S[N-1-i]:
        flag1=1
    else:
        flag1=0
        break
for i in range((N+1)//4):
    if S[i]==S[(N-3)//2-i]:
        flag2=1
    else:
        flag2=0
        break
for i in range((N+1)//2,N):
    if S[i]==S[(3*N-1)//2-i]:
        flag3=1
    else:
        flag3=0
        break
if flag1==1 and flag2==1 and flag3==1:
    print("Yes")
else:
    print("No")

Submission status: Accepted

Solution code:
S=input()
A=S[0:int(((len(S)-1)/2))]
B=S[int(((len(S)+3)/2-1)):len(S)]
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=sys.stdin.readline()

l=(len(s)-1)//2
judge=1
for i in range(l):
    if s[i]==s[l-i-1] and s[l+i+1]==s[2*l-i] and s[i]==s[l+i+1]:
        pass
    else:
        judge=0
        break
if judge==1:
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
def ispalindrome(str): return 1 if str == str[::-1] else 0

n = len(s)
front = s[:(n-1)//2]
back = s[(n+3)//2-1:]

if ispalindrome(s) and ispalindrome(front) and ispalindrome(back):
    print('Yes')
else:
    print('No')

Submission status: Accepted

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

ans = 'No'
if S == S[::-1]:
    if S[:N//2] == S[(N//2)-1::-1]:
        ans = 'Yes'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def is_kaibun(s):
    return list(s) == list(reversed(s))

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

Submission status: Accepted

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


flag = True
for i in range(len(s)//2):
    if s[i] == s[-1-i]:
        pass
    else:
        flag = False

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

for i in range(len(sub_s)//2):
    if sub_s[i] == sub_s[-1-i]:
        pass
    else:
        flag = False

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

for i in range(len(sub_s2)//2):
    if sub_s2[i] == sub_s2[-1-i]:
        pass
    else:
        flag = False

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

Submission status: Accepted

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

s = input()
n = len(s)
flag = False

def isKaibun (bun):
    rev = ''.join(list(reversed(bun)))
    f = False
    if rev == bun:
        f = True
    return f

s_sub_0 = s[ : int((n - 1) / 2)]
s_sub_1 = s[int((n + 3) / 2) - 1:]

if not isKaibun(s):
    flag = False
elif isKaibun(s_sub_0) and isKaibun(s_sub_1):
    flag = True

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

Submission status: Accepted

Solution code:
s = input()

#回文2
m = int((len(s)-1)/2)

#回文3
n = int((len(s)+3)/2)

s1 = s[:m]

s2 = s[n-1:]

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

Submission status: Accepted

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