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

Solution (Python):
def main(sample_file = ''):

    """ convenient functions
    
    
    
    
    
    """

    """convenient decorator
    
    
        
        
        
        
        
        
        
        
        
        
    """
    
    
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product 
    
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  
        b, e = 2, 0  
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):   
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict 
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest 
    from copy import deepcopy, copy 
    import operator
    from operator import itemgetter 
    
    
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd 
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)
    def make_divisors(n, reversed=False):
        """create list of divisors
        
        Args:
            number (int): number from which list of divisors is created
            reversed (bool, optional): ascending order if False. Defaults to False.
        
        Returns:
            list: list of divisors
        """
        divisors = set()
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divisors.add(i)
                divisors.add(n//i)
        return sorted(list(divisors),reverse=reversed)
    
    
    
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    AtoZ = list('abcdefghijklmnopqrsruvwxyz')
    modpow = lambda a, n, p = MOD: pow(a, n, p) 
    def modinv(a, p = MOD):
        
        
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        
        
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    class UnionFindTree:
        """union find tree class
        TODO: fix this description...
        how to use (example):
        >>  uf = UnionFindTree(N) 
        >>  if uf.find_root(a) == uf.find_root(b):
        >>      do something
        >>  else:
        >>      do something
        >>      uf.unite(a, b)
        """
        def __init__(self, N):
            self.root = [-1] * (N+1)
            self.rank   = [0]  * (N+1)
            self.connected_num = [1] * (N+1)
    
        def find_root(self,x):
            root = self.root
            while root[x] != -1:
                x = root[x]
            return x
    
        def unite(self,x,y):
            root = self.root
            rank = self.rank
            connected_num = self.connected_num
            find_root = self.find_root
    
            rx = find_root(x)
            ry = find_root(y)
            if rx != ry:
                if rank[rx] < rank[ry]:
                    root[rx] = ry
                    rx,ry = ry,rx
                else:
                    if rank[rx] == rank[ry]:
                        rank[rx] += 1
                    root[ry] = rx       
                connected_num[rx] += connected_num[ry]

    
    
    
    
    

    def BellmanFord(N, M, ABC, vertex_start, vertex_end, value_if_inf = -1, find_shortest = False):
        """to calculate furthest or shortest length between vertex_start and vertex_end using BellmanFord algorithm
        
        Args:
            N (int): number of vertices
            M (int): number of edges
            ABC (list): [(ai, bi, ci) for _ in range(N)] where i-th edge is directed from vertex ai to vertex bi and the length is ci 
            vertex_start (int): start vertex. usually use 0.
            vertex_end (int): end vertex. usually use N-1.
            value_if_inf (int or string as you like, optional): value you want when the furthest (or shortest) distance is infinite (or -infinite). Defaults to -1.
            find_shortest (bool, optional): choose False to find furthest path. Defaults to False.
        
        Returns:
            int or string: normally int (but can be str if you set value_if_inf to str)
            
        Example:
                N, M, P = R()
                ABC = [R() for _ in range(M)]
                ABC = [(a-1, b-1, c-P) for a, b, c in ABC]
                print(BellmanFord(N, M, ABC, 0, N-1, value_if_inf = 'inf'))

        """

        def make_reachable_list(N, M, ABC, vertex_start, vertex_end):
            reachable_to_direct = defaultdict(list)
            reachable_from_direct = defaultdict(list)
            reachable_from_start = [False] * N
            reachable_to_end = [False] * N
            reachable_from_start[vertex_start] = True
            reachable_to_end[vertex_end] = True
            reachable_from_both_sides = [False] * N
            dfs_from_start = []
            dfs_to_end = []
            for a, b, c in ABC:
                reachable_to_direct[a].append(b)
                reachable_from_direct[b].append(a)
                if a == vertex_start:
                    dfs_from_start.append(b)
                    reachable_from_start[b] = True
                if b == vertex_end:
                    dfs_to_end.append(a)
                    reachable_to_end[a] = True
            while dfs_from_start:
                v = dfs_from_start.pop()
                for i in reachable_to_direct[v]:
                    if not reachable_from_start[i]:
                        reachable_from_start[i] = True
                        dfs_from_start.append(i)
            while dfs_to_end:
                v = dfs_to_end.pop()
                for i in reachable_from_direct[v]:
                    if not reachable_to_end[i]:
                        reachable_to_end[i] = True
                        dfs_to_end.append(i)
            for i in range(N):
                reachable_from_both_sides[i] = reachable_from_start[i] and reachable_to_end[i]
            return reachable_from_both_sides
        
        reachable_from_both_sides = make_reachable_list(N, M, ABC, vertex_start, vertex_end)
        
        if find_shortest:
            dist = [INF for i in range(N)]
        else:
            dist = [-INF for i in range(N)]
        
        dist[vertex_start] = 0
        for i in range(N):
            updated = False
            for a, b, c in ABC:
                if not reachable_from_both_sides[a]:
                    continue
                elif find_shortest:
                    update_condition = dist[a] + c < dist[b]
                else:
                    update_condition = dist[a] + c > dist[b]
                if dist[a] != INF and update_condition:
                    dist[b] = dist[a] + c
                    updated = True
                    if i == N-1:
                        return value_if_inf
            if not updated:
                break
        return dist[vertex_end]

    """ initialize variables and set inputs
    
        
        
            
            
    
        
        
        
        
        
        
        
    
        
        
        
        
    
        
        
    """

    
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    r_float = lambda: float(r())
    R = lambda: list(map(int, r().split()))
    R_str = lambda: r().split()
    R_map = lambda: map(int, r().split())
    R_float = lambda: list(map(float, r().split()))
    R_tuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    
    
    
    
    
    
    
    """

    
    if sample_file:
        sys.stdin = open(sample_file)
        
    
    
    
    S = r()
    N = len(S) - 1
    def uragaeshi(u):
        return u[::-1]
    
    if S == uragaeshi(S) and S[:(N-1)//2+1] == uragaeshi(S[:(N-1)//2+1]) and S[(N+3)//2:] == uragaeshi(S[(N+3)//2:]):
        print('Yes')
    else:
        print('No')
    
    
    
    

    """memo: how to use defaultdict of list
    
    Dic = defaultdict(list)
    
    Dic[x].append(y)
    
    for k, v in Dic.items():
    """
    
    """memo: how to solve binary problems
    
    >>> a = 5
    >>> bin_str_a = format(a, '
    >>> print(bin_str_a)
    0b0101 
    """
    
    """memo: how to solve the problem
    creating simple test/answer
    greed
    simple dp
    graph
    """

if __name__ == '__main__':
    main()

Solution (Python):
S = list(input())
N = len(S)
if N%4 == 3 or N%4 == 1:
    if S[0:int((N-1)/2)] == S[int((N+1)/2):N]:
        flag = True
        s = S[0:int((N-1)/2)]
        for i in range(N//4):
            if s[i] != s[-i-1]:
                flag=False
        if flag:
            print('Yes')
        else:
            print('No')
    else:
        print('No')    
else:
    print('No')

Solution (Python):
s = input()

l = len(s)
cent = int((l - 1) / 2)


for i in range(cent):
    if s[i] != s[l-i-1]:
        print('No')
        exit(0)


for i in range(cent//2):
    if s[i] != s[cent - i - 1] or s[cent + 1 + i] != s[l-i-1]:
        print('No')
        exit(0)

print('Yes')

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

rev = ''.join(list(reversed(s)))


a = int((n-1)/2)
s1 = s[:a]
s_1 = ''.join(list(reversed(s1)))

b = int((n+3)/2)
s2 = s[b-1:n+1]
s_2 = ''.join(list(reversed(s2)))


if (s==rev) and (s1 == s_1) and (s2==s_2):
  print('Yes')
else:
  print('No')

Solution (Python):
s = input()

def is_palindrome(t):
	
	for i in range(len(t)//2):
		if t[i] != t[~i]:
			
			return False
	return True

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

Solution (Python):
S = input()
k1 = ''
k2 = ''
for i in range(0,(len(S) - 1) // 2):
  k1 += S[i]
for j in range(((len(S) + 3) // 2) - 1, len(S)):
  k2 += S[j]
if k1 == k1[::-1] and k2 == k2[::-1] and 3 <= len(S) <= 99 and len(S) % 2 == 1 and S == S[::-1]:
  print('Yes')
else:
  print('No')

Solution (Python):
s=input()

n=len(s)
flag=0
kaibun=0
l=[]

for i in range(int((n-1)/2)):
    if s[i] != s[n-1-i]:
        flag=1
    l.append(s[i])
    if flag ==1:
        break

if len(l)%2==0:
    for i in range(int(len(l)/2)):
        if l[i]!=l[len(l)-1-i]:
            kaibun=1
        if kaibun ==1:
            break
else:
    for i in range(int((len(l)-1)/2)):
        if l[i]!=l[len(l)-1-i]:
            kaibun=1
        if kaibun ==1:
            break  
if kaibun ==1 or flag==1:
    print('No')
else:
    print('Yes')

Solution (Python):
import math


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


def isStrongPalindrome(text):
    if isPalindrome(text):
        if isPalindrome(text[0:(len(text)-1)//2]):
            if isPalindrome(text[len(text)+3//2:]):
                return True
    return False


data = input()
    
if isStrongPalindrome(data):
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
n = len(s)
for i in range((n - 1)//4):
    if not(s[i] == s[(n-1)//2-i-1] and s[(n+3)//2 + i-1] ==  s[-i-1] and s[i] == s[-i-1]):
        print('No')
        exit()
if (n-1)%4 != 0:
    j = (n - 1) // 4
    if s[j] != s[-j-1]:
        print('No')
        exit()
print('Yes')

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

def checkPalindrome(inStr):
    strLen = len(inStr)
    if strLen%2 == 1:
        loopMax = (strLen + 1) / 2
    else:
        loopMax = strLen / 2
    loopMax = int(loopMax)
    for index in range(loopMax):
        if(inStr[index] != inStr[strLen-1-index]):
            return False
    return True

if(not checkPalindrome(S)):
    print('No')
elif(not checkPalindrome(S[0:int((N-1)/2)])):
    print('No')
elif(not checkPalindrome(S[int((N+3)/2-1):N])):
    print('No')
else:
    print('Yes')

Solution (Python):
s = input()
count = 0

if s[:int((len(s)-1)/2)] == s[int((len(s)+1)/2):]:
    for j in range(len(s)):
        if s[j] == s[-(j+1)]:
            count += 1
    
    if count == len(s):
      	print('Yes')
    else:
      	print('No')
else:
    print('No')

Solution (Python):
def main():
    s = input()
    rev_s = s[::-1]

    half_s = ['']*((len(s) - 1) // 2)
    for i in range((len(s) - 1) // 2):
        half_s[i] = s[i]
    rev_half_s = half_s[::-1]

    plus_three_s = [''] * (len(s) - ((len(s) + 3) // 2) + 1)
    count = 0
    for j in range(((len(s) + 3) // 2) - 1, len(s)):
        plus_three_s[count] = s[j]
        count += 1
    rev_plus_three_s = plus_three_s[::-1]

    if s == rev_s and half_s == rev_half_s and plus_three_s == rev_plus_three_s:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

Solution (Python):



import math

text = input()

def factrial(n):
    a = 0
    for i in range(1, n+1):
        a += i
    return a

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

r1 = (palindrome(text))
r2 = (palindrome(text[0:len(text) // 2]))
r3 = (palindrome(text[-(-len(text) // 2):]))
print('Yes' if r1 and r2 and r3 else 'No')

Solution (Python):
s = input()
n = len(s)
num = int((n-1)/2)-1
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()
    
num = int(num /2 -1)
for i in range(num):
  if s[i] != s[n-1-i]:
    print("No")
    exit()

num = int(len(s) * 0.5 - 1.5)
index = int((n + 3) /2 -1 )
for i in range(num):
  if s[index+i] != s[n-1-i]:
    print("No")
    exit()
   
  
print("Yes")

Solution (Python):
S=(input())
 
N = len(S)
 
one = S[0:((N-1)//2)]
two = S[(N+3)//2-1:N]
 
def check_kai(text):
    left = len(text)//2
    
    for i in range(left):
 
        if text[i] != text[len(text)-1-i]:
            print('No')
            exit(0)
 
check_kai(S)
check_kai(one)
check_kai(two)
print('Yes')

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

if len(S1) % 2 == 0:
    S3 = S1[0:int((len(S1) - 1) / 2) + 1]
    S4 = S1[int((len(S1) + 3) / 2) - 1:]
    S4.reverse()
else:
    S3 = S1[0:int((len(S1) - 1) / 2)]
    S4 = S1[int((len(S1) + 3) / 2) - 1:]
    S4.reverse()

if S1 == S2 and S3 == S4:
    print("Yes")
else:
    print("No")

Solution (Python):
def judgeKaibun(list):
    for index, item in enumerate(list):
        if list[index] != list[(-1 * index) -1]:
            return "No"

    h = int((len(list)-1)/2)
    halflist = list[:h]
    for index, item in enumerate(halflist):
        if halflist[index] != halflist[(-1 * index) -1]:
            return "No"
    return "Yes"

s = list(input())
print(judgeKaibun(s))

Solution (Python):
S = input()
N = len(S)
flg = True
i = 0
while i <= (N-3)/2:
    if S[i]!=S[int((N-3)/2-i)]:
        flg = False
    i += 1
i = N-1
while i >= (N+1)/2:
    if S[i]!=S[int((3*N-1)/2-i)]:
        flg = False
    i -= 1
i = 0
while i <= N-1:
    if S[i]!=S[N-1-i]:
        flg = False
    i += 1
if flg:
    print('Yes')
else:
    print('No')

Solution (Python):
stra = input()


def hantei(s):
    for i in range(int(len(s) / 2)):
        if (s[i] != s[len(s) - 1 - i]):
            
            return False
        if (int((len(s) + 3) / 2) - 1 + i < len(s) and s[(int((len(s) + 3) / 2)) - 1  + i] != s[len(s) - 1 - i]):
            
            return False

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


if(hantei(stra)):
    print("Yes")
else:
    print("No")

Solution (Python):
def palindrome(string): return 0 if string==string[::-1] else 1
stri = input()
s = list(stri)
a = len(s)//2
b = s[0:a]
c = s[a+1:]
d = palindrome(b)
e = palindrome(c)
f = palindrome(s)
if d==0 and e==0 and f==0:
    print('Yes')
else:
    print('No')

Solution (Python):
S = str(input())
N = len(S)
num= (N-1)/2
num1=(N+2)/2
if (S[:int(num)]== S[int(num1):]):
    print("Yes")
else:
    print("No")

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

def check_kaibun(string):
    rev_string = string[::-1]
    check_len = int(len(string) / 2)
    i = 0
    while i <= check_len:
        if string[i] != rev_string[i]:
            return False
        i += 1
    return True

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

Solution (Python):
s=input();h=len(s)//2;print(['No','Yes'][s[:h]==s[h-1::-1]==s[-h:]])

Solution (Python):
import math
import sys
s = input()
n = int(len(s))

if s[0:math.floor(n/2)] != s[math.ceil(n/2):]:
  print('No')
  sys.exit()

j = int((n-1)/2)-1
for i in range(int((n-1)/2)):
  if s[i] != s[j]:
    print('No')
    sys.exit()
  j -= 1

j=-1
for i in range(int((n+3)/2-1),n):
  if s[i] != s[j]:
    print('No')
    sys.exit()
  j -= 1

print('Yes')

Solution (Python):
s= input()
z=len(s)//2
flag=0
sd=s[0:z]
if len(s)==3:
    if s[0]==s[2]:
        flag=1
else:
    if sd==s[z+1:len(s)]:
        if sd==sd[::-1]:
            flag=1
if flag==1:
    print("Yes")
else:
    print("No")

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

S = list(input())
N = int(len(S))
mae = (N-1)//2
usiro = (N+3)//2

S_m = S[0:mae]
S_u = S[usiro-1:]

if ispalindrome(S_m) and ispalindrome(S_u) and ispalindrome(S):
  print('Yes')
else:
  print('No')

Solution (Python):
s=list(input())

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

s3.reverse()

if s1!=s3:
    print("No")
else :
    m=len(s1)
    if m%2==1:
        m1=(m-1)//2
        m3=(m+3)//2
        s11=s1[:m1]
        s33=s1[m3-1:]
        s33.reverse()
        if s11==s33:
            print("Yes")
        else:
            print("No")
    else:
        m1=(m)//2
        m3=m1+1
        s11=s1[:m1]
        s33=s1[m3-1:]
        s33.reverse()
        if s11==s33:
            print("Yes")
        else:
            print("No")

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

Solution (Python):
s = input()
if s == s[::-1]:
    flag = True
else:
    flag = False
N = len(s)
if flag:
    new = s[0:int((N-1)/2)]
    if new == new[::-1]:
        flag = True
    else: flag = False

if flag:
    new = s[int((N+2)/2):N]
    if new == new[::-1]:
        flag = True
    else:
        flag = False

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

Solution (Python):

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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


def test(S):
    N = len(S)
    words = []
    words.append(S)
    words.append(S[: (N - 1) // 2])
    words.append(S[(N + 1) // 2:])
    return all(T == T[::-1] for T in words)


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

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

S = list(input())
N = int(len(S))
mae = (N-1)//2
usiro = (N+3)//2

S_m = S[0:mae]
S_u = S[usiro-1:]

if ispalindrome(S_m) and ispalindrome(S_u) and ispalindrome(S):
  print('Yes')
else:
  print('No')

Solution (Python):
def checkPal(s):
  if s[::-1]==s:
    return True
  return False
s = input()
n = len(s)
if checkPal(s[:(n//2)]) and checkPal(s) and checkPal(s[(n//2)+1:]):
  print("Yes")
else:
  print("No")

Solution (Python):

s = input()
list_s = list(s)

ans = 'No'

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) == True : 

    second_moji = ''
    aaa = (len(s) - 1) / 2
    aaa = int(aaa)

    for i in range(aaa): 
        second_moji = second_moji + list_s[i]

    
    if is_kaibun(second_moji) == True :


        third_moji = ''
        bbb = (len(s) + 3) / 2
        bbb = int(bbb - 1)

        ccc = len(s) - bbb

        for i in range(ccc): 
            third_moji = third_moji + list_s[i + bbb]

            
            if is_kaibun(third_moji) == True :
                ans = 'Yes'
        
print(ans)

Solution (Python):
S = list(input())

if ''.join(S[:len(S)//2]) != ''.join(S[len(S)//2 + 1:]):
    print("No")
    exit()

a = len(S) - 1// 2

if ''.join(S[:a//2]) != ''.join(S[a//2 + 1:]):
    print("No")
    exit()

b = len(S) + 3 // 2 - 1

if ''.join(S[:b//2]) != ''.join(S[b//2 + 1:]):
    print("No")
    exit()

print("Yes")

Solution (Python):
"""
"""


def int_as_array(num): return list(map(int, [y for y in str(num)]))


def array_as_int(arr): return int(''.join(map(str, arr)))


def read_int(): return int(input())


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


def array_to_string(arr, sep=' '): return sep.join(map(str, arr))


def matrix_to_string(arr, sep=' '): return '[\n' + '\n'.join(
    [sep.join(map(str, row)) for row in arr]) + '\n]'


def solve(string):
    if string != string[::-1]:
        return False
    first = string[0:(len(string) - 1) // 2]
    if first != first[::-1]:
        return False
    second = string[(len(string) + 2) // 2:]
    if second != second[::-1]:
        return False
    return True


string = input()
if solve(string):
    print('Yes')
else:
    print('No')

Solution (Python):
S = list(input())
N = len(S)
flag = "Yes"
for i in range((N-1)//2):
    if S[i] != S[-i-1]:
        flag = "No" 


N2 = (N-1)//2
if N2 == 2:
    n = 1
else:
    n = N2
if flag == "Yes":
    for k in range(n):
        if S[k] != S[N2 -1 -k]:
            flag = "No"

if flag == "Yes":
    for k in range(n):
        if S[-k-1] != S[-(N2 -1 -k)-1]:
            flag = "No"

print(flag)

Solution (Python):
s = input()
if s == s[::-1]:
    flag = True
else:
    flag = False
N = len(s)
if flag:
    new = s[0:int((N-1)/2)]
    if new == new[::-1]:
        flag = True
    else: flag = False

if flag:
    new = s[int((N+2)/2):N]
    if new == new[::-1]:
        flag = True
    else:
        flag = False

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

Solution (Python):
s = input()

s_li = list(s)

rev_li = s_li[::-1]

n = len(s_li)
pre_n = (n - 1) // 2
sa_n = (n + 3) // 2 - 1

ans = True

if not s_li == rev_li:
    ans = False

if ans:
    pre_li = s_li[:pre_n]
    
    rev_pre_li = pre_li[::-1]
    if not pre_li == rev_pre_li:
        ans = False

if ans:
    sa_li = s_li[sa_n:]
    
    rev_sa_li = sa_li[::-1]
    if not sa_li == rev_sa_li:
        ans = False
        
if ans:
    print("Yes")
else:
    print("No")

Solution (Python):
def is_par(s):
    l, r = 0, len(s) -1
    while l <= r:
        if s[l] != s[r]:
            return False
        l += 1
        r -= 1
    return True

S = input()
N = len(S)

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

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

def isKaibun(s, length):
    flag = True
    if length == 2:
        counter = 1
    else:
        counter = round((length-1)/2)
    for i in range(counter):
        
        if s[i] != s[length-1-i]:
            flag = False
            break
    return flag



orta = int((n+1)/2)-1

if isKaibun(s, n) and isKaibun(s[:orta], orta) and isKaibun(s[orta+1:], orta):
    print("Yes")
else:
    print("No")

Solution (Python):
def check(s):
    i, j = 0, len(s) - 1
    while i < j:
        if s[i] != s[j]:
            return False
        i += 1; j -= 1
    return True
s = input()
n = len(s)
n_S = s[0:(n - 1)//2]
n_E = s[(n+3)//2 - 1::]

if check(s) and check(n_S) and check(n_E):
    print('Yes')
else:
    print('No')

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

i = input()
l = len(i)
x = int((l-1)/2)
y = int((l+3)/2-1)
ii = i[0:x]
iii = i[y:l]

if (ispalindrome(i) == 1) and (ispalindrome(ii) == 1) and (ispalindrome(iii) == 1):
  print('Yes')
else:
  print('No')

Solution (Python):
s = list(input())
for i in range(len(s)//2):
    if s[i] != s[len(s)//2-1-i]:
        print("No")
        exit()
for i in range(len(s)//2):
    if s[-1-i] != s[len(s)//2+1+i]:
        print("No")
        exit()
if s != s[::-1]:
    print("No")
else:
    print("Yes")

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


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

for j in range((n-1)//4):
  
  if s[j] != s[(n-1)//2 -j-1]:
    print('No')
    exit(0)
    

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

Solution (Python):
S = str(input())
N = len(S)
num = (N-1)/2
num1 = (N+2)/2
if(S[:int(num)]==S[int(num1):]):
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
input = sys.stdin.readline

def main():
    S = input().strip()

    n = (len(S) + 1) // 2

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

    k = len(a[:-1])



    if k % 2 == 1:
        kn = k // 2
        aa = a[:-1][:kn]
        ab = a[:-1][kn+1:]

        ba = b[1:][:kn]
        bb = b[1:][kn+1:]
    else:
        kn = k // 2
        aa = a[:-1][:kn]
        ab = a[:-1][kn:]

        ba = b[1:][:kn]
        bb = b[1:][kn:]

    if a==b[::-1] and aa==ab[::-1] and ba==bb[::-1]:
        print('Yes')
    else:
        print('No')




if __name__ == "__main__":
    main()

Solution (Python):
def main():
    S = input()
    len_s = len(S)
    flag = False
    if S == S[::-1]:
        if S[0:len_s // 2] == S[len_s // 2 - 1::-1]:
            if S[len_s // 2 + 1:] == S[-1:len_s // 2:-1]:
                flag = True
    
    
    if flag:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Solution (Python):
S = list(input())
S_rev = list(reversed(S))
N = len(S)
if S != S_rev:
  print('No')
else:
  S1 = S[:int((N-1)/2)]
  S2 = S[int((N+1)/2):]
  S1_rev = list(reversed(S1))
  S2_rev = list(reversed(S2))
  if S1==S1_rev and S2 == S2_rev:
    print('Yes')
  else:
    print('No')

Solution (Python):
S = input()

n = len(S)
ans = "No"
if S[:n//2] == S[n//2+1:][::-1]:
    S1 = S[:(n-1)//2]
    n1 = len(S1)
    if S1[:n1//2] == S1[(n1+1)//2:][::-1]:
        S2 = S[(n+3)//2-1:]
        n2 = len(S2)
        if S2[:n2//2] == S2[(n2+1)//2:][::-1]:
            ans = "Yes"

print(ans)

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

Solution (Python):
import math
S=input()
N=len(S)
S1=S[0:math.floor((N-1)/2)]
S2=S[math.floor((N+3)/2)-1:N]
if S1==S1[::-1]:
  if S2==S2[::-1]:
    if S==S[::-1]:
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')