Harryxun/stf_run huggingface dataset:
import math
import numpy as np
from itertools import permutations
N = int(input())
x = []; y= []
for _ in range(N):
    x_,y_ = map(int,input().split())
    x.append(x_)
    y.append(y_)
lis = np.zeros((8,8))
for i in range(N):
    for j in range(N):
        lis[i,j] = math.sqrt((x[i]-x[j])**2 + (y[i]-y[j])**2)
num = 0
su = 0
ite = permutations([i for i in range(N)])
for it in ite:
    for i in range(len(it)-1):
        su += lis[it[i],it[i+1]]
    num += 1
print(su/num)

### FIXED CODE ###

import math
import numpy as np
import itertools
N = int(input())
x = []; y= []
for _ in range(N):
    x_,y_ = map(int,input().split())
    x.append(x_)
    y.append(y_)
lis = np.zeros((8,8))
for i in range(N):
    for j in range(N):
        lis[i,j] = math.sqrt((x[i]-x[j])**2 + (y[i]-y[j])**2)
num = 0
su = 0
ite = itertools.permutations([i for i in range(N)])
for it in ite:
    for i in range(len(it)-1):
        su += lis[it[i],it[i+1]]
    num += 1
print(su/num)
n = int(input())
if 7 in n:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

def resolve():
    n = input()
    if n[0] == '7' or n[1] == '7' or n[2] == '7':
        print('Yes')
    else:
        print('No')
resolve()
import sys

# import re
import math
import collections
# import decimal
# import bisect
# import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    h, w, a, b = ns()

    flg1 = h * a == w * b
    flg2 = w % a == 0 and h % b == 0
    flg3 = a == 0 or b == 0
    if not(flg1 and flg2) and not flg3:
        print("No")
        exit(0)

    if b == 0:
        ans = "0" * a + "1" * (w - a)
        print(ans)
    elif a == 0:
        for _ in range(h):
            print("1" * w)
    else:
        for i in range(h // b):
            for j in range(b):
                ans = "1" * i + "0" * a + "1" * (w - a - a * i)
                print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys

# import re
import math
import collections
# import decimal
# import bisect
# import itertools
import fractions
# import functools
import copy
# import heapq
import decimal
# import statistics
import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))


# ===CODE===


def main():
    h, w, a, b = ns()

    for i in range(h):
        if i < b:
            print("0" * a + "1" * (w - a))
        else:
            print("1" * a + "0" * (w - a))


if __name__ == '__main__':
    main()
n = int(input())
a = list(input())
flag = False
for i in range(n):
  if a[i] == "Y":
    flag = True

if flag == Ture:
  print("Four")
else:
  print("Three")

### FIXED CODE ###

n = int(input())
a = list(input())
for i in range(n):
  if a[i] == "Y":
    print("Four")
    exit()
    
print("Three")
N = int(input())
a = [input() for i in range(N)]
print(a)

### FIXED CODE ###

HW = list(map(int, input().split()))
hw = list(map(int, input().split()))
H = HW[0]
W = HW[1]
h = hw[0]
w = hw[1]
r = H * W - (W * h + (H - h) * w)
print(r)
N, A, B, C, D = map(int, input().split())
N-=1
A-=1
B-=1
C-=1
D-=1
S = input()

massesExist = True
overtakeFlag = False if C > D else True
proceedableFlag = True

if max(A, B, C, D) > N:
    massesExist = False

for i in range(B, D+1):
    if S[i-1] == "." and S[i] == "." and S[i+1] == ".":
        overtakeFlag = True

for i in range(A, max(C, D)-1):
    if S[i]=="#" and S[i+1]=="#":
        proceedableFlag = False

if overtakeFlag and proceedableFlag and massesExist:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

N, A, B, C, D = map(int, input().split())
N-=1
A-=1
B-=1
C-=1
D-=1
S = input()

massesExist = True
overtakeFlag = False if C > D else True
proceedableFlag = True

if max(A, B, C, D) > N:
    massesExist = False

if not overtakeFlag:
    for i in range(B, D+1):
        if S[i-1] == "." and S[i] == "." and S[i+1] == ".":
            overtakeFlag = True

for i in range(A, max(C, D)-1):
    if S[i]=="#" and S[i+1]=="#":
        proceedableFlag = False

if overtakeFlag and proceedableFlag and massesExist:
    print("Yes")
else:
    print("No")
A, B, C, D, E, F = map(int, input().split())
waters = set()
sugars = set()
for i in range(F//(A*100)+1):
    for j in range(F//(B*100)+1):
        if i!=0 or j!=0:
            if A*i +B*j <= F:
                waters.add(100*A*i+100*B*j)
for i in range(F//(C)+1):
    for j in range(F//(D)+1):
        if C*i +D*j <= F:
            sugars.add(C*i+D*j)

max_ratio = 0
for water in waters:
    for sugar in sugars:
        ratio =  sugar/(water+sugar)
        if water+sugar<=F and sugar<=E*(water//100):
            if ratio > max_ratio:
                ans = (water+sugar, sugar)
                max_ratio = ratio
print(*ans)

### FIXED CODE ###

A, B, C, D, E, F = map(int, input().split())
waters = set()
sugars = set()
for i in range(F//(A*100)+1):
    for j in range(F//(B*100)+1):
        if i!=0 or j!=0:
            if A*i*100 +B*j*100 <= F:
                waters.add(100*A*i+100*B*j)
for i in range(F//(C)+1):
    for j in range(F//(D)+1):
        if C*i +D*j <= F:
            sugars.add(C*i+D*j)

max_ratio = 0
for water in waters:
    for sugar in sugars:
        ratio =  sugar/(water+sugar)
        if water+sugar<=F and sugar<=E*(water//100):
            if ratio >= max_ratio:
                ans = (water+sugar, sugar)
                max_ratio = ratio
print(*ans)
def find(parent,i):
    t = parent[i]
    if t < 0:
        return i
    t = find(parent,t)
    parent[i] = t
    return t
def unite(parent,i,j):
    i = find(parent,i)
    j = find(parent,j)
    if i == j:
        return
    parent[j] += parent[i]
    parent[i] = j
n,m = map(int,input().split())
parent = [-1] * n
ans = n*(n-1)//2
ansl = []
l0 = []
for i in range(m):
    ab = list(map(int,input().split()))
    ab[0] -= 1
    ab[1] -= 1
    l0.append(ab)
l0.reverse()
for i in range(m):
    ansl.append(ans)
    a,b = l0[i]
    if find(parent,a) != find(parent,b):
        ans -= parent[find(parent,a)] * parent[find(parent,b)]
    unite(parent,a,b)
ansl.reverse()
for i in range(m):
    print(ansl[i])

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 5)
def find(parent,i):
    t = parent[i]
    if t < 0:
        return i
    t = find(parent,t)
    parent[i] = t
    return t
def unite(parent,i,j):
    i = find(parent,i)
    j = find(parent,j)
    if i == j:
        return
    parent[j] += parent[i]
    parent[i] = j
n,m = map(int,input().split())
parent = [-1] * n
ans = n*(n-1)//2
ansl = []
l0 = []
for i in range(m):
    ab = list(map(int,input().split()))
    ab[0] -= 1
    ab[1] -= 1
    l0.append(ab)
l0.reverse()
for i in range(m):
    ansl.append(ans)
    a,b = l0[i]
    if find(parent,a) != find(parent,b):
        ans -= parent[find(parent,a)] * parent[find(parent,b)]
    unite(parent,a,b)
ansl.reverse()
for i in range(m):
    print(ansl[i])
N, M = map(int, input().split())

G = [[] for _ in range(N + 1)]
for i in range(M):
    x, y = map(int, input().split())
    G[x] += [y]
# print(G)

dp = [-1] * (N + 1)


def func(n):
    if dp[n] != -1:
        return dp[n]
    cnt = 0
	# 先にノードが存在する場合
	# ノードが存在しない場合は、cnt=0のままforをすっ飛ばす
    for m in G[n]:
        cnt = max(cnt, func(m) + 1)
    dp[n] = cnt
    return cnt


for i in range(1, N + 1):
    func(i)

# print(dp)
print(max(dp))


### FIXED CODE ###

# デフォルトだと再帰の上限が設定されている(1000)、足りない場合があるので上げる
import sys
sys.setrecursionlimit(10**9)


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

G = [[] for _ in range(N + 1)]
for i in range(M):
    x, y = map(int, input().split())
    G[x] += [y]
# print(G)

dp = [-1] * (N + 1)


def func(n):
    if dp[n] != -1:
        return dp[n]
    cnt = 0
	# 先にノードが存在する場合
	# ノードが存在しない場合は、cnt=0のままforをすっ飛ばす
    for m in G[n]:
        cnt = max(cnt, func(m) + 1)
    dp[n] = cnt
    return cnt


for i in range(1, N + 1):
    func(i)

# print(dp)
print(max(dp))
def main():
    from fractions import gcd
    n,x=map(int,input().split())
    num=[abs(int(i)-x) for i in input().split() if abs(int(i)-x)!=0]
    n=len(num)
    
    def gcd2(num,n):
        if n<=1:
          return num[0]
        elif n==2:
            return gcd(num[0],num[1])
        else:
            x=num.pop()
            return gcd(gcd2(num,n-1),x)
    
    print(gcd2(num,n))
if __name__=='__main__':
    main()

### FIXED CODE ###

from fractions import gcd
from functools import reduce
n,x=map(int,input().split())
num=[abs(int(i)-x) for i in input().split() if abs(int(i)-x)!=0]
print(reduce(gcd,num))
class Data:
    def __init__(self,n):
        self.n = n
        self.abc = []
        self.sum = 0
        self.history = [-1]*n
        self.ava = [[1,2],[0,2],[0,1]]

    def change_his(self,i):
        a = self.abc[i-1][self.history[i]] + max(self.abc[i][self.ava[self.history[i]][0]],self.abc[i][self.ava[self.history[i]][1]])
        b = max(self.abc[i-1][self.ava[self.history[i]][0]],self.abc[i-1][self.ava[self.history[i]][1]]) + self.abc[i][self.history[i]]
        if a>b:
            self.history[i] = self.abc[i].index( max(self.abc[i][self.ava[self.history[i]][0]],self.abc[i][self.ava[self.history[i]][1]]))
            
        elif a==b:
            self.history[i] = self.abc[i].index( max(self.abc[i][self.ava[self.history[i]][0]],self.abc[i][self.ava[self.history[i]][1]]))
        else:
            self.history[i-1] = self.abc[i].index(max(self.abc[i-1][self.ava[self.history[i]][0]],self.abc[i-1][self.ava[self.history[i]][1]]))
            if(self.history[i-1]==self.history[i-2]):
                self.change_his(i-1)
        return

    def input_abc(self):
        for i in range(self.n):
            self.abc.append(list(map(int,input().split())))

    def init(self):
        #print(self.abc)
        self.history[0] = self.abc[0].index(max(self.abc[0]))
    
    def count(self):
        for i in range(self.n):
            self.sum += self.abc[i][self.history[i]]

def main():
    n = int(input())
    data = Data(n)
    data.input_abc()
    data.init()
    for i in range(1,n):
        data.history[i] = data.abc[i].index(max(data.abc[i]))
        if(data.history[i-1] == data.history[i]):
            data.change_his(i)
    data.count()
    print(data.sum)

if __name__ == "__main__":
    main()

### FIXED CODE ###

class Data:
    def __init__(self,n):
        self.n = n
        self.abc = []
        self.dp = [[0,0,0]]

    def input_abc(self):
        for i in range(self.n):
            self.abc.append(list(map(int,input().split())))
    
    def chmax(self,i,j,k):
        a = self.dp[i-1][j] + self.abc[i-1][k]
        b = self.dp[i][k]
        if (a>b):
            self.dp[i][k] = a
        #print("j",j,"k",k,a,b,"\n",self.dp)
def main():
    n = int(input())
    data = Data(n)
    data.input_abc()
    for i in range(1,n+1):
        data.dp.append([0,0,0])
        for j in range(3):
            for k in range(3):
                if j != k:
                    data.chmax(i,j,k)
    print(max(data.dp[i]))

if __name__ == "__main__":
    main()
n=int(input())
p=list(map(int,input()))
ans=0
for i in range(1,n-1):
  pre=p[i-1]
  cur=p[i]
  nex=p[i+1]
  if (pre<cur and cur<nex) or(pre>cur and cur>nex):
    ans+=1
print(ans)

### FIXED CODE ###

n=int(input())
p=list(map(int,input().split()))
ans=0
for i in range(1,n-1):
  pre=p[i-1]
  cur=p[i]
  nex=p[i+1]
  if (pre<cur and cur<nex) or(pre>cur and cur>nex):
    ans+=1
print(ans)
from math import atan
a, b, x = map(int, input().split())
x = x / a ** 2
if x >= b / 2:
    print(atan(a / (2 * b - 2 * x)))
else:
    print(atan(2 * a * x / b ** 2))

### FIXED CODE ###

from math import atan, degrees
a, b, x = map(int, input().split())
if x == a * b * b:
    print(0)
else:
    x = x / a ** 2
    if x >= b / 2:
        print(90-degrees(atan(a / (2 * b - 2 * x))))
    else:
        print(90-degrees(atan(2 * a * x / b ** 2)))
a, b, k = map(int, input().split())
x = list(range(a, b+1))

for i in sorted(set(map(int, x[:k] + x[-k:]))):
    print(i)

### FIXED CODE ###

a, b, k = map(int, input().split())
x = range(a, b+1)

for i in sorted(set(x[:k]) | set(x[-k:])):
    print(i)
N, M= map(int, input().split())

if M == 0:
    print('No')
if N < M:
    print('No')

A = [int(input()) for i in range(N)]


B = []
for i in range(len(A)):
    if A[i] > sum(A)/4/M:
        B.append(1)
    else:
        B.append(0)

if sum(B) > M:
    print('Yes')
else:
    print('No')


### FIXED CODE ###


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

C = map(int, input().split())

A = list(C)

#if N < M:
#    print('No')
#if M == 0:
#    print('No')

B = []
for i in range(len(A)):
    if A[i] >= sum(A)/4/M:
        B.append(1)
    else:
        B.append(0)

if sum(B) >= M:
    print('Yes')
else:
    print('No')
x=input()
n=int(x)**3
print(n)
​


### FIXED CODE ###



x=input()
n=int(x)**3
print(n)
N = input()
print(N//3)

### FIXED CODE ###

N = int(input())
print(N//3)
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
X = 0
for i in range(N-1):
  if A[i] == A[i+1]-1 :
    X += (B[i]+C[i+1])
  else:
    X += B[i]
X += B[N-1]  
print(X)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
X = B[A[0]-1]
for i in range(1,N):
  if A[i] == A[i-1]+1 :
    X += (B[(A[i]-1)]+C[(A[i-1]-1)])
  else:
    X += B[(A[i]-1)]
print(X)
# -*- coding: utf-8 -*-

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

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

def array_count(arr):
    arr_target = [[]]
    cnt = 1
    for i in range(1,len(arr)):
        if arr[i] == arr[i-1]:
            cnt += 1
        else:
            arr_target.append([arr[i-1],cnt])
            cnt = 1
    arr_target.append([arr[len(arr)-1],cnt])
    del arr_target[0]
    return arr_target

fac = factorize(p)
arr = array_count(fac)

ans = 1
for i in range(len(arr)):
    if arr[i][1] >= n:
        ans *= arr[i][0]

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-

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

def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

def array_count(arr):
    arr_target = [[]]
    cnt = 1
    for i in range(1,len(arr)):
        if arr[i] == arr[i-1]:
            cnt += 1
        else:
            arr_target.append([arr[i-1],cnt])
            cnt = 1
    arr_target.append([arr[len(arr)-1],cnt])
    del arr_target[0]
    return arr_target

fac = factorize(p)

if len(fac) >= 1:
    arr = array_count(fac)

    ans = 1
    for i in range(len(arr)):
        if arr[i][1] >= n:
            ans *= arr[i][0] ** (arr[i][1] // n)

    print(ans)
else:
    print(1)
n, a, b = map(int, input().split())
total = 0
for x in range(n+1):
    X = [int(x) for x in list(str(x))]
    sum_x = sum(X)
    if a <= sum_x <= b:
        total += x
print(total)

### FIXED CODE ###

A, B, C, D = map(int, input().split())

if (A+B) > (C+D):
    print("Left")
elif (A+B) < (C+D):
    print("Right")
else:
    print("Balanced")
#coding: utf-8

from math import factorial
N = int(input())

s_list = []
for i in range(N):
    input_string = list(input())
    input_string.sort()
    input_string = "".join(input_string)
    s_list.append(input_string)

count = 0
s_list.sort()
tmp_count = 0
for i in range(1, len(s_list)):
    if s_list[i-1] == s_list[i]:
        tmp_count = tmp_count + 1
    else:
        if tmp_count == 0:
            pass
        else:
            tmp_count = tmp_count + 1
            count = count + int(factorial(tmp_count) / factorial(2) / factorial(tmp_count - 2))
        tmp_count = 0

if tmp_count == 0:
    pass
else:
    tmp_count = tmp_count + 1
    count = count + int(factorial(tmp_count) / factorial(2) / factorial(tmp_count - 2))

print(count)


### FIXED CODE ###

#coding: utf-8

from collections import Counter
N = int(input())

s_list = []
for i in range(N):
    input_string = list(input())
    input_string.sort()
    input_string = "".join(input_string)
    s_list.append(input_string)

s_list.sort()

list_counter = Counter(s_list)

count = 0
for key in list_counter.keys():
    tmp_count = list_counter[key]
    if tmp_count < 2:
        pass
    elif tmp_count == 2:
        count += 1
    else:
        permutations = tmp_count * (tmp_count - 1)
        combination = permutations/2
        count += int(combination)

print(int(count))
n, x = map(int, input().split())
l = list(map(int, input().split()))
n = n - 1
l_d = []
d = 0
i = 0
l_d.append(d)
d = d + l[i]
while (d <= x) & (i <= n):
    l_d.append(d)
    i += 1
    d = d + l[i]
print(len(l_d))

### FIXED CODE ###

n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
c = 1
for i in l:
    d += i
    if d <= x:
        c += 1
    else:
        break
print(c)
n = int(input()
s = {}
for i in range(n):
    si = input()
    if si in s:
        s[si] +=1
    else:
        s[si] = 0
l = max(s.values())
ans = []
for i in s:
    if s[i] == l:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)

### FIXED CODE ###

from collections import  Counter
n = int(input())
a  = [input() for i in range(n)]
cnt = Counter(a)
l = max(cnt.values())
ans = [s for s,c in cnt.items()if c ==l]
ans.sort()
print('\n'.join(ans))
import numpy as np
    N = list(input())
    a = list(map(int,input().split()))
     
    for i in range(1,10):
      b = np.array([n/2 if n%2==0 else 0 for n in a])
      a = b
      if 0 in list(b):
        print(i-1)
        exit()

### FIXED CODE ###

import numpy as np
N = list(input())
a = list(map(int,input().split()))

for i in range(1,31):
  b = np.array([n/2 if n%2==0 else 0 for n in a])
  a = b
  if 0 in list(b):
    print(i-1)
    exit()
N = int(input())
S = []
ans = N
for i in range(N):
    S.append(input())
    flg = 0
    j  = 0
    while(flg == 0 and j < i):
        if i != j:
            if len(S[j]) == len(S[i]):
                if S[j][0] == S[i][0]:
                    if S[j] == S[i]:
                        S[j] = ''
                        ans = ans - 1
                        flg = 1
        j = j+1
print(ans)

### FIXED CODE ###

S, W = map(int, input().split())
if S <= W:
    print('unsafe')
else:
    print('safe')
n = int(input())
s = list(input())
l = []
 
for i in range(n):
  l.append(s[i])
 
 
print(len(set(l)))

### FIXED CODE ###

n = int(input())
s = [input() for i in range(n)]
S = len(set(s))

print(S)
l = raw_input().split()
print l[0]*l[1], 2*l[0]+2*l[1]

### FIXED CODE ###

i = list(map(int, input().split()))

print(i[0]*i[1], i[0]*2+i[1]*2)
N = int(input())
a = map(int, input().split())

print(max(a) - min(a))

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))

print(max(a) - min(a))
N=input()
s=input()

print(s.count('ABC'))

### FIXED CODE ###

k,x=input().split()

if 500*int(k)>=int(x):
	print("Yes")
else:
	print("No")
import sys
sys.setrecursionlimit(10010)
n,m,k=map(int,input().split())

L=[[] for i in range(1+n)]
Ncnt=[0 for i in range(1+n)]
C=[0 for i in range(1+n)]

for inp in range(m):
    a,b=map(int,input().split())
    L[a].append(b)
    L[b].append(a)



def tansa(x,gone,color):
    C[x]=color
    for nex in L[x]:
        if nex in gone:
            continue
        else:
            tansa(nex,gone+(nex,),color)

now=1
for i in range(1,n):
    if C[i]==0:
        tansa(i,(i,),now)
        now+=1

CC=sorted(C)

cnt=0
ccres=[]
for i in range(now):
    ccres.append(CC.index(i))
ccres.append(n+1)
dic={i:ccres[i+1]-ccres[i] for i in range(1,now)}

#print(C)
#print(dic)

for inp in range(k):
    a,b=map(int,input().split())
    if C[a] == C[b]:
        Ncnt[a]+=1
        Ncnt[b]+=1

for i in range(1,n):
    print(dic[C[i]]-len(L[i])-Ncnt[i]-1,end=" ")
i=n
print(dic[C[i]]-len(L[i])-Ncnt[i]-1,end="")

### FIXED CODE ###

n,m,k=map(int,input().split())
BAD=[0 for i in range(n+1)]

E=[]
for inp in range(m):
    a,b=map(int,input().split())
    E.append((a,b))
    BAD[a]-=1
    BAD[b]-=1

B=[] 
for inp in range(k):
    a,b=map(int,input().split())
    B.append((a,b))
    
uf=[i for i in range(n+1)]
def uf_find(x,uf=uf):
    while uf[x]!=x:
        x=uf[x]
    return x       


res=[]

for ele in E:
    if uf_find(ele[0]) == uf_find(ele[1]):
        continue
    else:
        res.append((ele[0],ele[1])) #write result
        
        if uf_find(ele[0])>uf_find(ele[1]):
            uf[uf_find(ele[0])]=uf_find(ele[1])
        else:
            uf[uf_find(ele[1])]=uf_find(ele[0])

SCO=[0 for i in range(n+1)]
for i in range(1,n+1):
    SCO[uf_find(i)]+=1


for bl in B:
    if uf_find(bl[0])==uf_find(bl[1]):
        BAD[bl[0]]-=1
        BAD[bl[1]]-=1

ANS=[str(SCO[uf_find(i)] + BAD[i] -1) for i in range(1,n+1)]
print(" ".join(ANS))
Not found

### FIXED CODE ###

s = input()
print(s.rfind("Z") - s.find("A") + 1)
s=input()
n=len(s)
for i in range(n):
    if not s[i]==s[n-1-i]:
        print('No')
        quit()
for i in range(int(n*(n-1)/2)):
    if not s[i]==s[int((n*(n-1))/2)-1-i]:
        print('No')
        quit()
for i in range(int(n*(n-1)/2)):
    if not s[int(n*(n+3)/2)-1+i]==s[n-1-i]:
        print('No')
        quit()
else:
    print('Yes')

### FIXED CODE ###

s=input()
n=len(s)
for i in range(n):
    if not s[i]==s[n-1-i]:
        print('No')
        quit()
for i in range((n-1)//2):
    if not s[i]==s[(n-1)//2-1-i]:
        print('No')
        quit()
for i in range((n-1)//2):
    if not s[(n+3)//2-1+i]==s[n-1-i]:
        print('No')
        quit()
print('Yes')
n, d = map(int, input().split())
from sys import stdin

n, d = map(int, input().split())
x = []
for i in range(n):
        x.append(list(map(int,input().split())))

ans = 0
for i in range(n):
    tmp = 0
    for j in range(d):
        tmp += (x[i][j] - x[(i+1)%n][j])**2
    if tmp**(1/2)%1 == 0:
        ans += 1
print(ans)

### FIXED CODE ###

from sys import stdin

n, d = map(int, input().split())
x = []
for i in range(n):
        x.append(list(map(int,input().split())))

ans = 0
for i in range(n):
  for k in range(i+1, n):
    tmp = 0
    for j in range(d):
        tmp += (x[i][j] - x[k][j])**2
    if tmp**(1/2)%1 == 0:
        ans += 1
print(ans)
h, w = map(int, input().split())
src = [input() for i in range(h)]

ans = []
for row in src:
        ans.append(list(row))

flag = 0
dxy = [(1, 0), (-1, 0), (0, 1), (0, -1)]
for x in range(h):
        for y in range(w):
                if src[x][y] == ".":
                        continue
                else:
                        for dx, dy in dxy:
                                if x + dx < 0 or x + dx > h -1 or y + dy < 0 or y + dy > w - 1:
                                        continue
                                if src[y +dy][x+dx] == "#":
                                        flag = 1
                                        break
                        if flag == 0:
                                print("No")
                                exit()

print("Yes")

### FIXED CODE ###

h, w = map(int, input().split())
src = [input() for i in range(h)]

ans = []
for row in src:
        ans.append(list(row))

dxy = [(1, 0), (-1, 0), (0, 1), (0, -1)]
for x in range(h):
        for y in range(w):
                if src[x][y] == ".":
                        continue
                if src[x][y] == "#":
                        flag = 0
                        for dx, dy in dxy:
                                if x + dx < 0 or x + dx > h -1 or y + dy < 0 or y + dy > w - 1:
                                        continue
                                if src[x + dx][y + dy] == "#":
                                        flag = 1
                                        break
                        if flag == 0:
                                print("No")
                                exit()

print("Yes")