peterverebics/CodeNet_Python_118 huggingface dataset:
from scipy.misc import comb
N,M = (int(x) for x in input().split())
a = comb(N, 2) + comb(M, 2)
print(a)
ST = input().split()
N = int(ST[0])
M = int(ST[1])
print((N*(N-1)+(M*(M-1)))/2)
n, m = map(int, input().split())
if n == 1:
  if m == 1:
    print(0)
  else:
    print((m * (m-1) / 2))
elif m == 1:
  print((n * (n-1) / 2))
else:
  print((n * (n-1) / 2) + (m * (m-1) / 2))
n,m = map(int,input().split())
if(m == 1):
    m = 0
print(((n*(n-1))//2)+m)
n,w=map(int,input().split())
print(n*(n-1)/2+w*(w-1)/2)
N, M = (int(x) for x in input().split())
print(N*(N-1)/2+M*(M-1)/2)
n, m = map(int, input().split())

even = n * (n-1)/2
odd = m * (m-1)/2

print(even + odd)
import math

n, m = map(int, input().split(' '))
if n >= 2:
    ret_n = n * (n - 1) / 2
else:
    ret_n = 0

if m >= 2:
    ret_m = m * (m - 1) / 2
else:
    ret_m = 0

print(ret_n + ret_m)
inp = input().split(' ')

n = int(inp[0])
m = int(inp[1])

ncount = 0 if n < 2 else n*(n-1)/2
mcount = 0 if m < 2 else m*(m-1)/2

print(str(ncount + mcount))
ls = list(input())
n = len(ls)
rvls = ls[::-1]

fh = int((n-1) /2)
fhls = ls[:fh]
rvfhls = fhls[::-1]

sh = int((n+3)/2-1)
shls = ls[sh:]
rvshls = shls[::-1]

if ls == rvls and fhls==rvfhls and shls == rvshls:
    print('Yes')
else:
    print('No')
n, m = map(int, input().split(" "))
print((n*(n-1) + m*(m-1)) / 2)
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
#  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()
def kaibun(str):
    return True if str == str[::-1] else False

s = input()
if not kaibun(s) :
    print('No')
    exit()
n = len(s)
n1 = (n - 1) // 2
if not kaibun(s[:n1]) :
    print('No')
    exit()
n2 = (n + 3) // 2 - 1
if not kaibun(s[n2:]) :
    print('No')
    exit()
print('Yes')
n, m = map(int, input().split())
c = 0
if n!=0:
  c+= n*(n-1)/2
print(c)
N, M = map(int, input().split())

print(N*(N-1) + M*(M-1))
n, m = map(int, input().split())
a=(n*(n-1))/2+(m*(m-1))/2
print(m)
I = input().split()

N = int(I[0])
M = int(I[1])

print( N*(N-1)/2 + M*(M-1)/2 )
n, m = map(int, input().split())

p = n * (n - 1) / 2 + m * (m - 1) / 2

print(p)
n,m = (map(int,input().split()))
print(n*(n-1)/2 + m*(m-1)/2)
def a(N,M):
  if N<=1 and M<=1:
    return 0
  elif N<=1:
    return M*(M-1)/2
  elif M<=1:
    return N*(N-1)/2
  else:
    return N*(N-1)/2+M*(M-1)/2
n,m=map(int,input().split())
print(n*(n-1)/2 + m*(m-1)/2)
n,m = map(int,input().split())
ans = n*(n-1)/2 + m*(m-1)/2
print(ans)
import sys

N, M = map(int, input().split())

def combination(n,r):
    if n == 1:
        ans = 0

    if r != 1:
        ans = n/r * combination(n-1,r-1)
    elif r == 1:
        ans = n/r

    return ans

print(combination(N,2)+combination(M,2))
def uhe(x):
    return x%2

a,b=map(int,input().split())
c=list(range(2,a*2+1,2))
d=list(range(1,b*2+1,2))

e=[(x+y) for x in c for y in d]
f=list(map(uhe,e))
print(f.count(0))
n,m = map(int,input().split())
print(n*(n+1)/2+m*(m+1)/2)
a = [int(i) for i in input().split()]

x= a[0] * (a[0]-1) * (1/2)

x+= a[1] * (a[1]-1) * (1/2)

print(x)
N,M = map(int,input().split())
a = N+M
b = N+M-1
print(a*b/2-N*M)
N,M=map(int,input().split())
print("N(N-1)/2 +M(M-1)/2")
import math
a=4
b=3
answer = 0

#偶数2
if a > 1 :
    answer += math.factorial(a) / (math.factorial(a - 2)*2)

#奇数2
if b > 1:
    answer += math.factorial(b) / (math.factorial(b - 2)*2)

print(int(answer))
a = list(map(int, input().split()))

b = a[0] * a[0]-1 / 2 + a[1] * a[1] -1 / 2

print(b)
N,M = map(int,input().split())
print(N*(N-1)/2 + M*(M-1)/2)
n, m = map (int, input().split())
ex1 = n*(n-1)/2
ex2 = m*(m-1)/2
ans = ex1 + ex2
print(ans)
N, M = map(int, input().split())

print(N*(N-1)//2)
N,M = map(int,input().split())
ans1 = N*(N-1)/2
ans2 = M*(M-1)/2
A = ans1+ans2
print(A)
import itertools
N,M=map(int,input().split())
c=0
for (a,b) in itertools.combinations(list(range(2,101,2))[:N]+list(range(1,100,2))[:M],2):
    c += 1 if (a+b)%2==0 else 0
print(c)
x, y = map(int, input().split())
result1 = x * (x - 1) // 2
result2 = y * (y - 1) // 2
result = result1 + result2
print(result1)
n, m = map(int, input().split())

pn = n*(n-1) / 2
pm = m*(m-1) / 2

p = pn + pm
print(p)
N, M = map(int, input().split())

odd_list = [x*2 for x in range(N)]
even_list = [2*y-1 for y in range(M)]

odd_num = 0

for i in range(N):
  for j in range(M):
    if (i + j) % 2 == 0:
      odd_num += 1

print(odd_num)
N,M = map(int,input().split())
a = N+M
b = N+M-1
c = a*b/2
print(c-N*M)
S=str(input())
N=len(S)
if S[1:int(N-1)//2] == S[int(N+3)//2:N]:
  print('Yes')
else:
  print('No')
N,M = map(int,input().split())

if N == 0 or M == 0:
    print(1)
else:
    print(int(((M * (M - 1)) + (N * (N - 1))) / 2))
n,m = map(int, input().split())
print(int((n+m)*(n+m-1))-n*m)
N, M = map(int, input().split())

print((N * (N-1) / 2) + (M * (M-1) / 2))
n,m=map(int,input().split())
if n==0: 
    print((n*(n-1))/2)
elif m==0:
    print((m*(m-1))/2)
else:
    print(int(n*(n-1)/2+m*(m-1)/2))
n,m = map(int,input().split())
##偶数+偶数(n+n)
n1 = n*(n-1)/2
##奇数+奇数(m+m)
m1 = m*(m-1)/2
##print
print(n1 + m1)
N,M = map(int, input().split())
ans1 = 0
ans2 = 0

if(N >= 2):    
    ans1 = (N*(N-1))/2
if(M >= 2):
    ans2 = (M*(M-1))/2

print(ans1+ans2)
N,M=map(int,input().split())
even=(N*(N-1))/2
odd=(M*(M-1))/2
print(even+odd)
N, M = map(int, input().split())
method1 = N*(N-1)/2
method2 = M*(M-1)/2
method=method1+method2
print(str(method))
from scipy.misc import comb


N, M = map(int, input().split())
result = 0
if N >= 2:
    result += comb(N, 2)
if M >= 2:
    result += comb(M, 2)
print(int(result))
data = input().split()
N = int(data[0])
M = int(data[1])

C = N * (N - 1) / 2 + M * (M - 1) / 2
print(C)
i = list(map(int, input().split()))
N = i[0]
M = i[1]

guusuu = (N * N-1) // 2
kisuu = (M * M-1) // 2

print(guusuu + kisuu)
a,b = input().split()
a = int(a)
b = int(b)
A = (a*a-1)/2
B = (b*b-1)/2
if a == 1 and b == 1:
  print(0)
elif a ==1 and b >= 1:
  print(B)
elif a >= 1 and b == 1:
  print(A)
elif a>= 1 and b >=1:
  print(A+B)
s,t=(int(x) for x in input().split())
print(s*(s-1) /2 + t*(t-1)/2)
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, M = list(map(int,input().split()))
print(N * (N-1) /2 + M * (M-1) / 2)
N, M = map(int, input().split())
print((N//2) + (M // 2))
S = input()
L=len(S)
ans=0
if S[:int((L-1)/2)]==S[int((L-1)/2-1)::-1] and S[int((L+3)/2-1):]==S[:int((L+3)/2-2):-1]:
    ans='Yes'
else:
    ans='No'
print(ans)
n,m = map(int, input().split())

print(n*(n-1)/2+m*(m-1)/2)
S = list(input())
N = len(S)
s1 = S[:int((N-1)/2):]
s2 = S[int(((N+3)/2)-1):int(N):]
if S == S[::-1] :
    if s1 == s1[::-1] and s2 == s2[::-1] :
        print("Yes")
    else:
        print("No")
else:
    print("No")
#我が偶数になるのは、(偶数, 偶数)か(奇数, 奇数)の時
N, M = map(int, input().split())
print(N * (N - 1) + M * (M - 1))
n, m = map(int, input().split())
if n*m == 1:
  print(0)
else:
  print(n*(n-1)/2+m*(m-1)/2)
a,b = map(int,input().split())
print(a*(a-1)/2+b*(b-1)/2)
N, M = map(int, input().split())
ans = N * (N- 1) / 2 + M * (M - 1) / 2
print(ans)
n, m = map(int,input().split())
x = (n*(n-1)) / 2
y = (m*(m-1)) / 2
print(x+y)
N, M = map(int, input().split())

ans = N*(N-1) + M*(M-1)

print(ans)
n,m=map(int,input().split())
print((n*(n-1)+m*(m-1))/2)
#!/usr/bin/env python3

import sys

sys.setrecursionlimit(10 ** 6)


def main():
	pass

main()
n,m = map(int, input().split())
print(n*(n-1)+m*(m-1))
m, n = map(int, input().split())
print(m * (m - 1)/2 + n * (n - 1)/2)
from math import factorial

N, M = [int(i) for i in input().split()]
ans = 0
if N > 1:
    ans += int(factorial(N) / factorial(2) / factorial(N - 2))
if M > 1:
    ans += int(factorial(M) / factorial(2) / factorial(M - 2))

print(ans)
import math
N,M=map(int,input().split())
def kumiawase(n):
    if n>2:
        a=math.factorial(n)
        r=math.factorial(2)
        return a / (r*math.factorial(n-2))
    return 0

print(int(kumiawase(M)+kumiawase(N)))
n, m = map(int, input().split())

ans = n * (n - 1) / 2 + m * (m - 1) / 2

print(ans)
N,M = map(int,input().split())
while N > 0:
  A = N - 1
  A += A
  N -= N
while M > 0:
  B = M - 1
  B += B
  M -= M
else:
  print(str('A + B'))
NM = input("").split()
N = int(NM[0])
M = int(NM[1])


K = N*(N-1)/2 + M*(M-1)/2

print(K)
N, M = map(int, input().split())

ans = N * (N-1) / 2 + M * (M-1) / 2
print(ans)
n, m = map(int, input().split())
a = n*(n-1)/2 + m*(m-1)/2
print(a)
n, m = map(int, input().split())
print((n*(n-1) + m*(m-1))/2)
import math
n,k = input().split()
n = int(n) 
k = int(k)
se = 0

if k > 1:
    if n > 1:
        se = math.factorial(k)//(math.factorial(k-2)*2) + math.factorial(n)//(math.factorial(n-2)*2)
    else:
        se= math.factorial(k)//(math.factorial(k-2)*2)
else:
    if n > 1:
        se =  math.factorial(n)//math.factorial(n-2)*2
    else:
        se = 0
print(se)
N, M = map(int, input().split())
a = N*(N-1)/2
b = M*(M-1)/2
print(a+b)
N, M = map(int, input().split())
ans = N*(N-1)/2 + M*(M-1)/2
print(ans)
x, y = map(int, input().split())
result_x = 0
result_y = 0
if x > 1:
    result_x = 0
    for i in range(x):
        result_x = result_x + i

if x > 1:
    result_y = 0
    for i in range(y):
        result_y = result_y + i


print(result_x + result_y)
n,m= map(int, input().split())
if (n==0) and (m==0):
  print('0')
elif (n==1) and (m==0):
  print('0')
elif (n==0) and (m==1):
  print('0')
elif (n==1) and (m==1):
  print('0')
elif  (n==0) and (m >= 2):
  print(m*(m-1)*0.5)
elif  (n==1) and (m >= 2):
  print(m*(m-1)*0.5)
elif (n>=2) and (m ==0):
  print(n*(n-1)*0.5)
elif (n>=2) and (m ==1):
  print(n*(n-1)*0.5)
else:
  print(n*(n-1)/2 +m*(m-1)/2)
def main():
 n,m = map(int,input().split())
 print(n + (n - 1) / 2 + m * (m - 1) / 2)
main()
n,m = map(int, input().split())
print(n*(n-1)/2 + m*(m-1)/2)
N,M = map(int,input().split())
Q = N*(N-1)*0.5
P = M*(M-1)*0.5
print(P+Q)
#スペース区切りの整数入力
N, M  = map(int,input().split())

if N > 2:
    N_even = N*(N - 1)/2
else:
    N_even = 0

if M > 2:
    M_even = M*(M-1)/2
else:
    M_even = 0

print(int(N_even + M_even))
n,m=map(int,input().split())
if n==0: 
    print(n*(n-1)/2)
elif m==0:
    print(m*(m-1)/2)
else:
    print(n*(n-1)+m*(m-1))
S = list(input())
N1 = int(len(S))
N2 = int((N1-1)/2)

if S[:N2] == S[N2-1::-1] or N1 == 1:
	if S == S[::-1]:
		print("Yes")
else:
	print("No")
N,M=map(int,input().split())

n=0
m=0

if N>1:
    n=(N*(N-1))/2

if M>1:
    m=(M*(M-1))/2

print(n+m)
N,M=map(int,input().split())

print((N*(N-1)/2)+(M*(M-1)/2))
S = input()
L = list(S)
len = int(len(L))

L1 = L[:(len-1)//2]
L1_r = L1[::-1]
L2 = L[(len+3)//2-1:]
L2_r = L2[::-1]

if(L1==L1_r and L2==L2_r):
    print("Yes")
else:
    print("No")
n,m = map(int,input().split())
if n == 0:
  print(m*(m-1)/2)
elif n == 1:
  if m == 1:
    print('0')
  else:
    print(m*(m-1)/2)
elif m == 0:
  print(n*(n-1)/2)
elif m == 1 and n>=2:
  print(n*(n-1)/2)
else:
  print(m*(m-1)/2 + n*(n-1)/2)
N, M = map(int, input().split())
nC2 = N * (N - 1) / 2
mC2 = M * (M - 1) / 2
print(nC2+mC2)
n,m=map(int,input().split())
if n==0: 
    print(n*(n-1)/2)
elif m==0:
    print(m*(m-1)/2)
else:
    print(n*(n-1)/2+m*(m-1)/2)
s = list(input())

f1 = s == list(reversed(s))
f2 = s[:(len(s)-1)//2] == list(reversed(s[:(len(s)-1)//2]))
f3 = s[(len(s)+2)//2:] == list(reversed(s[(len(s)+2)//2:]))
print("Yes" if all([f1, f2, f3]) else "No")
S = input()
n = len(S)
p = (n-1)//2
q = (n+3)//2 - 1
A = S[:p]
B = S[q:]
ans = 'Yes'
for i in range(len(S)):
    if S[i] != S[-i-1]:
        ans = 'No'
for i in range(len(A)):
    if A[i] != A[-i-1]:
        ans = 'No'
for i in range(len(B)):
    if B[i] != B[-i-1]:
        ans = 'No'
print(ans)
def factrial(n):
    if n < 2:
        return 1
    return n * factrial(n-1)

def combination(n,m):
    return factrial(n) / factrial(m) / factrial(n-m)

def solve(n, m):
    return combination(n, 2) + combination(m, 2)

def main():
    n, m = map(int, input().split())
    ans = solve(n, m)
    print(ans)

if __name__ == '__main__':
    main()
i = input().split()
n = int(i[0])
m = int(i[1])

sum = 0

if n > 2:
    sum += 2 ** (n // 2)
elif n == 2:
    sum += 1

if m > 2:
    sum += 2 ** (m // 2)
elif m == 2:
    sum += 1

print(sum)
a = list(map(int, input().split()))
if a[0]<=1:
  n=0
else:
  n=a[0]*(a[0]-1)/2

if a[1]<=1:
  m=0
else:
  m=a[1]*(a[1]-1)/2
 
print(n+m)
n,m = input().split()
n=int(n)
m=int(m)

nout =n* (n-1)/2
mout =m* (m-1)/2

print(nout+mout)
n, m = map(int, input().split())
p=n//2
q=0
for i in range(m):
    q = q + i
print(p + q)
import sys
s = input()
n = len(s)
l = (n - 1) // 2
m = n // 4
for i in range(m):
  if s[i] != s[l - i - 1] or s[i] != s[l + i + 1] or s[i] != s[n - i - 1]:
    print('No')
    sys.exit()
print('Yes')
import operator as op
from functools import reduce

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer / denom
  
N, M = map(int, input().split())

if N < 2:
	if M < 2:
		print(0)
	else:
		print(ncr(M,2))
elif M < 2:
	print(ncr(N,2))
else:
	print(int(ncr(N,2)+ncr(M,2)))
a,b = map(int,input().split())
print(str(a*(a-1)/2 + b*(b-1)/2))
gusu, kisu = input().split()
gusu = int(gusu) # 個数
kisu = int(kisu) # 個数
# 両者とも偶数から選べば偶数
total = int(gusu / 2.)

# 奇数どうしの足し算は全て偶数
total = total + int(kisu / 2.)

print(total)
N,M=map(int,input().split())
print(int(N*(N-1)+M*(M-1))/2)
N,M = map(int,input().split())
ans = 0
for x in range(N):
    for y in range(M):
        if x * 2 + y % 2 == 0:
            ans += 1
print(ans)
#! env/bin/local python3
# -*- coding: utf-8 -*-

n, m = map(int, input().split())

pick_up_from_n = n * (n - 1) / 2
pick_up_from_m = m * (m - 1) / 2

print(pick_up_from_m + pick_up_from_n)
# solution

n,m = map(int,input().split())
print("solution is")
print(n*(n-1)//2 + m*(m-1)//2)
N,M = map(int, input().split())
print((N*(N-1)/2)+(M*(M-1)/2))
a = list(map(int, input().split()))


def a1():
    if a[0] == 1 or a[0] == 0:
        a[0] = 1
        return a[0]
    else:
        return a[0] * (a[0] - 1) / 2


def b1():
    if a[1] == 1 or a[1] == 0:
        a[1] = 1
        return a[1]
    else:
        return a[1] * (a[1] - 1) / 2


print(a1() + b1())
N,M = map(int,input().split()) 
ans = (N-1)*N/2
ans =ans + (M-1)*M/2
print(ans)
import operator as op
from functools import reduce

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer // denom

n,m = map(int,input().strip().split())
if n<=1 and m <=1:
    print(0)
if n <= 1:
    print(ncr(m,2))
elif m <= 1:
    print(ncr(n,2))
else:
    print(ncr(m,2) + ncr(n,2))
o, e = input().split()
o = int(o);
e = int(e);

num1 = o * (o-1) / 2;
num2 = e * (e-1) / 2;

print(num1+num2)
n,m = list(map(int,input().split()))
res = 0
if n >= 2:
  res += (n * (n - 1)) / 2
if m >= 2:
  res += (m * (m - 1)) / 2
print(res)
n,m=map(int, input().split())

num1=n*(n-1)*0.5
num2=m*(m-1)*0.5

print(num1+num2)
n, m = map(int, input().split())
 
c = 0

if n!=0:
  c+= n*(n-1)/2
if m!=0:
  c+= m*(m-1)/2
print(c)
n,m=map(int,input().split())
k=n*(n-1)/2
l=m*(m-1)/2
if n>=2 and m>=2:
    print(k+l)
elif n>=2 and m<2:
    print(k)
elif n<2 and m>=2:
    print(l)
else:
    print(0)
num = input("")
num = num.split(" ")
N = int(num[0])
M = int(num[1])
a = N*(N-1) if N*(N-1) >= 0 else 0
b = M*(M-1) if M*(M-1) >= 0 else 0
print(a + b)
a = list(map(int,input().split()))
print(a)

count = 0
for i in range(a[0]):
  count += i
 
for i in range(a[1]):
  count += i
  
print(count)
n, m = map(int, input().split())
print((n * (n-1) / 2) + (m * (m-1) / 2))
N,M = [int(i) for i in input().split()]

print((N * (N-1)/2) + (M *(M-1)/2))
import math
def com(a):
  if a == 0 or a == 1:
    return 0
  elif a == 2:
    return 1
  else:
    return math.factorial(a)/2/math.factorial(a-2)

A = list(map(int, input().split()))
print(com(A[0])+com(A[1]))
n,m = map(int,input().split())
print(max(0,m+(m-1)//2)+max(0,n*(n-1)//2)-1)
#ABC159A
import sys
import itertools
n, m = map(int, sys.stdin.readline().split())
#print(n, m)
L = [0 for _ in range(n)] + [1 for _ in range(m)]
L = list(itertools.combinations(L, 2))
#print(L)
total = 0
for a, b in L:
    if (a+b)%2 ==0:
        total+=1
import sys
from math import factorial

def comb(n,r):
    a = factorial(n) / factorial(r) / factorial(n - r)
    return int(a)

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


N, M = map(int, read().split())

a = comb(N, 2) if N>=2 else 0
b = comb(M, 2) if M >=2 else 0
ans = a + b
print(ans)
m,n=(int(x) for x in input().split());
even = m*(m-1)/2;
odd = n*(n-2)/2;

result = even + odd;
print(result);
def out(m, n):
  a = m*(m-1)%2 + n*(n-1)%2
  return a

m, n = map(int, input().split())
a = out(m,n)

print(a)
from itertools import *


N, M = map(int, input().split())

n = 2
m = 1

n_obj = [n*2 for n in range(1, N+1)]
m_obj = [m+1 for m in range(M)]

n_cnt = list(combinations(n_obj,2))
n_len = len(n_cnt)

m_len = len(m_obj)

if N <= 1 and M <= 1:
    print('0')

else:
    print(n_len + m_len)
N, M = map(int, input().split())
ans = 0
ans += N * (N - 1) / 2
ans += M * (M - 1) / 2
print(ans)
n,m = map(int,input().split())

print((n+m)*(n+m-1)/2-n*m)
n, m = map(int, input().split())

ans = 0
for i in range(1,n+1):
    ans += n-i

if m > 1:
    ans += m
    
print(ans)
N,M= map(int,input().split())
print(N*(N-1)/2+M*(M-1))
n, m = map(int,input().split())
if (n < 2):
  a = 0
else:
  a = n*(n - 1)/2
if (m < 2):
  b = 0
else:
  b = m*(m - 1)/2
print(a + b)
n,m=map(int,input().split())
if n>=2 and m>=2:
    print(n*(n-1)/2+m*(m-1)/2)
elif n>=2 and m<2:
    print(n*(n-1)/2)
elif n<2 and m>=2:
    print(m*(m-1)/2)
else:
    print(0)
N,M=map(int, input().split())
print(N*(N-1)/2+M*(M-1)/2)
n,m = input().split()
n = int(n)
m = int(m)
k = (n*(n-1) + m*(m-1))/2
print(k)
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')
s = list(input())
t = s[::-1]
n = len(s)
if s != t:
  print ('No')
  exit()
if n == 3:
  print('Yes')
  exit()
d = s[:int((n-1)/2)]
e = d[::-1]
#print(d,e)
r = s[int((n+3)/2-1):]
q = r[::-1]
#print(r,q)
if d != e:
  print('No')
  exit()
if r != q:
  print ('No')
  exit()
  
print('Yes')
S=input()
N=len(S)
M=(N-1)//2
def iskaibun(T):
    K=len(T)
    for i in range(K):
        if T[i]==T[-i-1]:
            pass
        else:
            return False
    return True

if iskaibun(S) and iskaibun(S[:M]) and iskaibun(S[M+1:]):
    print("Yes")
else:
    print("No")
import sys
S = input()
N = len(S)
s = S[::-1]

if S != s:
    print('No')
    exit()

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

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

print('Yes')
s = str(input())

n = len(s)
ans = 'Yes'

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

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

print(ans)
# -*- coding: utf-8 -*-
# 入力
S = input()
# 演算
N = len(S)
if S[0:int((N-1)/2)] == S[int((N+3)/2)-1:N]:
  print("Yes")
else:
  print("No")
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


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

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

    tmp = S[:(N - 1) // 2]
    if tmp != tmp[::-1]:
        print("No")
        return

    tmp = S[(N + 3) // 2 - 1:]
    if tmp != tmp[::-1]:
        print("No")
        return

    print("Yes")


if __name__ == '__main__':
    main()
def ispalindrome(S,N):
    for a, b in zip(S[:N], reversed(S[:N])):
        if a != b: return 0
    return 1

def ispalindrome2(S,N):
    for a, b in zip(S[N2-1:N], reversed(S[N2-1:N])):
        if a != b: return 0
    return 1

S = input()
N = len(S)
N1 = (N-1)//2
N2 = (N+3)//2

r1 = ispalindrome(S,N)
r2 = ispalindrome(S,N1)
r3 = ispalindrome2(S,N2)
if r1==1 and r2==1 and r3==1:
    print('Yes')
else:
    print('No')
a = input()
def p(s,n):
    for i in range(n//2):
        if s[i] != s[-(i+1)]:
            return 0
    return 1
r = len(a)
if p(a,r) == 1 and p(a[:((r-1)//2)],(r-1)//2) == 1 and p(a[(r+3)//2-1:],r-(r+3)//2+1)== 1:
    print("Yes")
else:
    print("No")
#!/usr/bin/env python3
import sys
s = input()
for i in range(len(s)//2):
    if s[i] != s[-1-i]:
        print("No")
        sys.exit()
s2 = s[:(len(s)-1)//2]
for i in range((len(s)-1)//2):
    if s2[i] != s2[-1-i]:
        print("No")
        sys.exit()
s3 = s[(len(s)+3)//2-1:]
for i in range((len(s)-1)//2):
    if s3[i] != s3[-1-i]:
        print("No")
        sys.exit()
print("Yes")
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')
a = input()
rev_a = ''.join(list(reversed(a)))
# join    iterator to list and  join them into one string
# we cannot change iterator into string directly

length = len(a)
#palindrome_check
if a == rev_a:
    a1 = a[0:length//2]
    rev_a1 = ''.join(list(reversed(a1)))
    
    a2 = a[length//2+1:length]
    rev_a2 = ''.join(list(reversed(a2)))
    
    if a1 == rev_a1 and a2 == rev_a2:
        print('Yes')
    else:
        print('No')
else:
    print('No')
s=input()
n=len(s)//2
print('Yes'if s[:n]==s[n-1::-1]==s[-n:]else'No')
S = input()
S1, S2 = S[:(len(S) - 1) // 2], S[(len(S) + 3) // 2 - 1:]
print("Yes" if S[::-1] == S and S1[::-1] == S1 and S2[::-1] == S2 else "No")
def isKaibun(ss):    
    return ss==ss[::-1]

s = input()
ans=True
n=len(s)

if not isKaibun(s):
    ans=False
if not isKaibun(s[:((n-1)//2)]):
    ans=False

if ans:
    print("Yes")
else:
    print("No")
S = input().strip()
N = len(S)
a = S[:(N-1)//2]
if S==S[::-1] and a==a[::-1]:
    print("Yes")
else:
    print("No")
def isKaibun(str):
  result = True
  for i in range(len(str)-1//2):
    if str[i] != str[-i-1]:
      result = False
      break
  return result

S = input().strip()
#N, M = list(map(int, input().strip().split()))
result = 'No'
N = len(S)
"""
print(S[0:(N-1)//2])
print(isKaibun(S[0:(N-1)//2]))
print(S[(N+3)//2-1::])
print(isKaibun(S[(N+3)//2-1::]))
"""
if isKaibun(S) and isKaibun(S[0:(N-1)//2]) and isKaibun(S[(N+3)//2-1::]):
  result = 'Yes'
print(result)
S = input()
H = len(S)//2
 
if S[:H] == S[-H:] == S[-H:][::-1]:
  print("Yes")
else:
  print("No")
if __name__ == "__main__":
    s = input()
    n = len(s)//2
    sf = s[0:n]
    sb = s[n+1:n]
    if s == s[::-1] and sf == sf[::-1] and sb == sb[::-1]:
        print("Yes")
    else:
        print("No")
S = input()
N = len(S)
if S == S[::-1] and  S[:(N-1)//2] == S[(N-3)//2::-1] and S[(N+1)//2:] == S[:(N-1)//2:-1] :
  print('Yes')
else:
  print('No')
import sys


def input():
    return sys.stdin.readline()[:-1]

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

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

flg = True

if s != s[::-1]:
    flg = False
if c2 != c2[::-1]:
    flg = False
if c3 != c3[::-1]:
    flg = False
    
    
print('Yes' if flg else 'No')
s = input()
a = s[:int((len(s) - 1) / 2)]
b = s[int(((len(s) + 3) / 2) - 1):]
if a == a[::-1] and b == b[::-1] and s == s[::-1]:
  print('Yes')
else:
  print('No')
letter = str(input())
N = len(letter)

l_1 = letter[:int((N-1)/2)]
l_2 = letter[int((N+3)/2-1):]

if(letter == letter[::-1] and l_1 == l_1[::-1] and l_2 == l_2[::-1]):
    ans = "Yes"
else:
    ans = "No"
# print(l_1)
# print(l_2)

print(ans)
s=input()
n=len(s)
def isk(S):
  l=len(S)
  f=1
  for i in range(l//2+1):
    if S[i]==S[l-i-1]:
      f*=1
    else:
      f=0
  if f:
    return True
  else:
    return False
  
if isk(s) and isk(s[:(n-1)//2]) and isk(s[(n+1)//2:]):
  print('Yes')
else:
  print('No')