Harryxun/stf_run huggingface dataset:
def search(i, cnt):
    if i <= n - 2 and h[i] >= h[i + 1]:
        search(i + 1, cnt + 1)
    else:
        li.append(cnt)
n = int(input())
h = list(map(int, input().split()))
li = []
for j in range(n):
    search(j, 0)
print(max(li))

### FIXED CODE ###

n = int(input())
h = list(map(int, input().split()))
cnt = 0
l = []
for i in range(n - 1):
    if h[i] < h[i + 1]:
        l.append(cnt)
        cnt = 0
    else:
        cnt += 1
l.append(cnt)
print(max(l))
w,h,x,y = map(int, input().split())


if y/x == h/w:
    num = 1
else:
    num = 0

print(h*w/2, num)

### FIXED CODE ###

w,h,x,y = map(int, input().split())


if w == 0 or h == 0:
    print(0,0)

if x == 0 or y == 0:
    print(h*w/2, 0)
else:
    if y/x == h/w:
        if x != w and y != h:
            num = 1
        else:
            num = 0
    else:
        num = 0

    print(h*w/2, num)
l = input().split()
l_int = [int(a) for a in l]
N = l_int[0]
K = l_int[1]
 
print(min(N%K, abs(K - (N%K)))

### FIXED CODE ###

i = input()
l = i.split()
print(l[2] + ' ' + l[0] + ' ' + l[1])
import math
 
N, X = map(int, input().split())
town = list(map(int, input().split()))
 
for i in range(N):
  if town[i] < X:
    town[i] = X - town[i]
  else:
    town[i] = town[i] - X
    
if N == 1:
  print("qaaq")
  
gcd = town[0]
for i in range(1, N):
  gcd = math.gcd(gcd, town[i])
print(gcd)
  

### FIXED CODE ###

import fractions
  

N, X = map(int, input().split())
town = list(map(int, input().split()))
 
for i in range(N):
  if town[i] < X:
    town[i] = X - town[i]
  else:
    town[i] = town[i] - X
  
gcd = town[0]
for i in range(1, N):
  gcd = fractions.gcd(gcd, town[i])
print(gcd)
def main():
    h, w = map(int, input().split())
    grid = []
    for height in range(0, h):
        grid.append(list(input()))

    replaced = []
    for height in range(0, h):
        replaced.append([0] * w)

    dx = [0, 0, 1, 1, 1, -1, -1, -1]
    dy = [1, -1, 1, -1, 0, 1, -1, 0]

    for height in range(0, h):
        for width in range(0, w):
            if grid[height][width] == '#':
                replaced[height][width] = '#'
            for i in range(0, 8):
                if (height + dy[i] < 0) or (height + dy[i] >= h) or (width + dx[i] < 0) or (width + dx[i] >= w):
                    continue
                if (grid[height + dy[i]][width + dx[i]]) == '#':
                    replaced[height][width] += 1

    for height in range(0, h):
        for width in range(0, w):
            print(replaced[height][width], end='')
        print()


if __name__ == "__main__":
  main()


### FIXED CODE ###

def main():
    h, w = map(int, input().split())
    grid = []
    for height in range(0, h):
        grid.append(list(input()))

    replaced = []
    for height in range(0, h):
        replaced.append([0] * w)

    dx = [0, 0, 1, 1, 1, -1, -1, -1]
    dy = [1, -1, 1, -1, 0, 1, -1, 0]

    for height in range(0, h):
        for width in range(0, w):
            if grid[height][width] == '#':
                replaced[height][width] = '#'
                continue
            for i in range(0, 8):
                if (height + dy[i] < 0) or (height + dy[i] >= h) or (width + dx[i] < 0) or (width + dx[i] >= w):
                    continue
                if (grid[height + dy[i]][width + dx[i]]) == '#':
                    replaced[height][width] += 1

    for height in range(0, h):
        for width in range(0, w):
            print(replaced[height][width], end='')
        print()


if __name__ == "__main__":
  main()
H, W =[int(i) for i in input().split()]
if H*W=1:
     print(1)
elif H==1 and W!=1:
     print(max(0, W-2))
elif W==1 and H!=1:
     print(max(0, H-2))
else:
     print(max(H-2, 0)*max(W-2, 0))

### FIXED CODE ###

H,W =[int(i) for i in input().split()]
if H*W==1:
    print(1)
elif H==1 and W!=1:
    print(max(0, W-2))
elif W==1 and H!=1:
    print(max(0, H-2))
else:
    print(max(H-2, 0)*max(W-2, 0))
import math

a,b,c,d = map(float, input().split()) 

e=6*d
f=30*c+0.5*d

if e<f:
    kakudo=f-e
    
if kakudo>180:
    kakudo=360-kakudo

a2=a*a
b2=b*b
i=math.cos(math.radians(kakudo))
j=2*a*b*i
print(math.sqrt(a2+b2-j))


### FIXED CODE ###


import math

a,b,c,d = map(float, input().split()) 

e=6*d
f=30*c+0.5*d

if e<f:
    kakudo=f-e
else:
    kakudo=e-f
    
if kakudo>180:
    kakudo=360-kakudo

a2=a*a
b2=b*b
i=math.cos(math.radians(kakudo))
j=2*a*b*i
print(math.sqrt(a2+b2-j))
n = int(input())
A = list(map(list(), input().split()))
ans = [0]*n
for i in range(n):
  ans[A[i]-1] = i+1
ans.sort()
print(ans)

### FIXED CODE ###

n = int(input())
A = list(map(int, input().split()))
ans = [0]*n
for i in range(n):
  ans[A[i]-1] = i+1
print(*ans)
def Fib(n, memo={}):
    if n == 1:
        return 0
    elif n == 2:
        return 1
    elif n in memo:
        return memo[n]
    else:
        memo[n] = Fib(n-1, memo) + Fib(n-2, memo)
        return memo[n]
    
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]

x=0
L=[]
for i in range(M):
    L += [A[i] - 1 - x]
    x = A[i] + 1
L += [N - x]
L = [Fib(i+2)%1000000007 for  i in L]

X=1
for i in range(len(L)):
    X *= L[i]
    X %= 1000000007 
print(X)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)

from itertools import product

def mat2_mul(X, Y):
    Z = [ [0, 0], 
          [0, 0] ]
    for (i,j,k) in product(range(2),range(2),range(2)):
        Z[i][j] += X[i][k] * Y[k][j]
    return Z

def mat2_pow(X, n):
    if n == 0:
        return [ [1, 0],
                 [0, 1] ]
    elif n % 2:
        return mat2_mul(X, mat2_pow(X, n-1))  
    else:
        half_pow = mat2_pow(X, n/2)
        return mat2_mul(half_pow, half_pow)

def Fib(n):
    if n == 0:
        return 0
    else:
        F = [ [0, 1],
              [1, 1] ]
        return mat2_pow(F, n-1)[1][1]
    
    
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]

x=0
L=[]
for i in range(M):
    L += [A[i] - 1 - x]
    x = A[i] + 1
L += [N - x]
L = [Fib(i+1)%1000000007 for  i in L]

X=1
for i in range(len(L)):
    X *= L[i]
    X %= 1000000007 
print(X)
sS = input().rstrip()
#iK = int(input())
if sS[0] == "1":
    if iK !=1:
        print(sS[1])
    else:
        print(sS[0])
else:
    print(sS[0])


### FIXED CODE ###


sS = input().rstrip()
iK = int(input())

for i in range(iK):
    if sS[i] != "1" :
        print(sS[i])
        exit()
print(sS[i])
a = int(input().split())
b = int(input().split())

c = a * b

ans = 'Even' if c % 2 == 0 else 'Odd'
print(ans)


### FIXED CODE ###

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

c = i[0] * i[1]

ans = 'Even' if c % 2 == 0 else 'Odd'
print(ans)
from collections import*
from heapq import*
def dijkstra(s):
  d=[float('inf')]*n
  used=[True]*n
  d[s]=0
  used[s]=False
  edgelist=[]
  for e in edge[s]:
    heappush(edgelist,e)
  while len(edgelist):
    minedge=heappop(edgelist)
    if not used[minedge[1]]:
      continue
    v=minedge[1]
    d[v]=minedge[0]
    used[v]=False
    for e in edge[v]:
      if used[e[1]]:
        heappush(edgelist,(e[0]+d[v],e[1]))
  return d
n,m,*t=map(int,open(0).read().split())
if m<1:
  print(-1)
  exit()
e=defaultdict(list)
s=[]
l=[]
for a,b,c in zip(t[::3],t[1::3],t[2::3]):
  if b<a:a,b=b,a
  if b==n:l.append(b+n*c)
  e[a].append((1,a+n*c))
  e[b+n*c].append((0,b))
  e[a+n*c].append((0,b+n*c))
  s.extend([a,b,a+n*c,b+n*c])
d={i:v for v,i in enumerate(sorted(set(s)))}
n=len(d)
edge=tuple([]for _ in range(n))
for i in e:
  edge[d[i]].extend([(c,d[j])for c,j in e[i]])
a=dijkstra(0)
a=min(a[d[i]]for i in l)
print([a,-1][a==float('inf')])

### FIXED CODE ###

def main():
  from heapq import heappush,heappop,heapify
  inf=2**31-1
  n,m,*t=map(int,open(0).read().split())
  z=[]
  for a,b,c in zip(t[::3],t[1::3],t[2::3]):
    z.extend([a,b,a+n*c,b+n*c])
  z={i:v for v,i in enumerate(sorted(set(z)))}
  try:
    z[1]
  except:
    print(-1)
    exit()
  edge=[[]for _ in range(len(z))]
  d={}
  l=[]
  for a,b,c in zip(t[::3],t[1::3],t[2::3]):
    if b<a:a,b=b,a
    i,j,x,y=z[a],z[b],z[a+n*c],z[b+n*c]
    if b==n:
      l.append(y)
    edge[i].append((1,x))
    edge[j].append((1,y))
    edge[x].extend([(0,i),(0,y)])
    edge[y].extend([(0,j),(0,x)])
  used=[False]+[True]*~-len(z)
  d=[0]+[inf]*~-len(z)
  edgelist=edge[0]
  heapify(edgelist)
  while edgelist:
    m=heappop(edgelist)
    if not used[m[1]]:
      continue
    d[m[1]]=m[0]
    used[m[1]]=False
    for e in edge[m[1]]:
      if used[e[1]]:
        heappush(edgelist,(e[0]+m[0],e[1]))
  a=min([d[i]for i in l]or[inf])
  print([a,-1][a==inf])
if __name__=='__main__':
  main()
a=input()
b=[]
for i in f:
  b.append(i)
cons=0
for j in b:
  if j=='R':
    cons=cons+1
print cons

### FIXED CODE ###

a=input()
sum=0
if a[0]=='R':
    sum=1
    if a[0]==a[1]:
        sum=2
        if a[1]==a[2]:
            sum=3
else :
    if a[1]=='R':
        sum=1
        if a[2]==a[1]:
            sum =2
    elif a[2]=='R':
        sum=1
print (sum)
l = [map(int, input())]

l.sort()

print(l[0] + l[1])

### FIXED CODE ###

p,q,r = map(int, input().split())

l = [p, q, r]

l.sort()

print(l[0] + l[1])
n=int(input())
ch=input()
if n%2==1:
    print('No')
else:
    if ch[:n//2]==ch[n//2:]:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

n=int(raw_input())
ch=raw_input()
if ch[:n//2]==ch[n//2:]:
        print('Yes')
else:
        print('No')
n = int(input())
l = [int(i) for i in input().split()]
sum = 0
i = 0
while i < n:
    j = i+1
    while j <= n:
        sum += l[i] * l[j]
        j += 1
    i += 1
print(sum)

### FIXED CODE ###

n = int(input())
l = [int(i) for i in input().split()]
sum = 0
i = 0
while i < n-1:
    j = i+1
    while j < n:
        sum += l[i] * l[j]
        j += 1
    i += 1
print(sum)
n = int(input())
dishes = list(map(int, input().split()))
points = list(map(int, input().split()))
bonuses = list(map(int, input().split()))

score = 0
prev = 0
for i in dishes:
  score += points[i-1]
  if prev > 0:
    if i == prev + 1: score += bonuses[i-1]
  prev = i


### FIXED CODE ###

n = int(input())
dishes = list(map(int, input().split()))
points = list(map(int, input().split()))
bonuses = list(map(int, input().split()))

score = 0
prev = 0
for i in dishes:
  score += points[i-1]
  if prev > 0:
    if i == prev + 1: score += bonuses[i-2]
  prev = i

print(score)
W, H, N = map(int, input().split())

for Nimport numpy as np

W, H, N = map(int, input().split())

ze = np.ones(W+1, H+1)
for i in range(N):
    li = [x, y, a = map(int, input().split()) for i in range(N)]
    
    if a == 1:
        ze[:x, :] = 0
    elif a == 2:
        ze[x+1:, :] = 0
    elif a == 3:
        ze[:, :y] = 0
    elif a == 4:
        ze[:, y+1:] = 0

print(np.sum(ze))

### FIXED CODE ###

import numpy as np

W, H, N = map(int, input().split())

ze = np.ones((W, H))

for i in range(N):
    x, y, a = map(int, input().split())

    if a == 1:
        ze[:x, :] = 0
    elif a == 2:
        ze[x:, :] = 0
    elif a == 3:
        ze[:, :y] = 0
    elif a == 4:
        ze[:, y:] = 0

print(np.sum(ze))
from math import gcd
import numpy as np

def setwise_coprime_check_fun(A_list, N):
    gcd_all = A_list[0]
    for i in range(N - 1):
        gcd_all = gcd(gcd_all, A_list[i + 1])
        if gcd_all == 1:
            break
    return gcd_all

def preprocess_fun(A_max):
    p_flg = [True] * (A_max + 1)
    D = [0] * (A_max + 1)
    p_flg[0] = False
    p_flg[1] = False
    for i in range(2, A_max + 1, 1):
        if p_flg[i]:
            for j in range(i, A_max + 1, i):
                p_flg[j] = False
                D[j] = i
    return D

def pairwise_coprime_check(A_list, D):
    p_count = [0] * (max(A_list) + 1)
    for A in A_list:
        temp = A
        d = 0
        while temp != 1:
            if p_count[D[temp]] == 1 and d != D[temp]:
                return 0
            elif d != D[temp]:
                p_count[D[temp]] = 1
                d = D[temp]
            temp = temp // D[temp]
    return 1


# 整数の最大値を取得
A_max = max(A_list)

# 本体
if(setwise_coprime_check_fun(A_list, N) != 1):
    print("not coprime")
else:
    D = preprocess_fun(A_max)
    if pairwise_coprime_check(A_list, D) == 1:
        print("pairwise coprime")
    else:
        print("setwise coprime")

### FIXED CODE ###

from math import gcd
import numpy as np

def setwise_coprime_check_fun(A_list, N):
    gcd_all = A_list[0]
    for i in range(N - 1):
        gcd_all = gcd(gcd_all, A_list[i + 1])
        if gcd_all == 1:
            break
    return gcd_all

def preprocess_fun(A_max):
    p_flg = [True] * (A_max + 1)
    D = [0] * (A_max + 1)
    p_flg[0] = False
    p_flg[1] = False
    for i in range(2, A_max + 1, 1):
        if p_flg[i]:
            for j in range(i, A_max + 1, i):
                p_flg[j] = False
                D[j] = i
    return D

def pairwise_coprime_check(A_list, D):
    p_count = [0] * (max(A_list) + 1)
    for A in A_list:
        temp = A
        d = 0
        while temp != 1:
            if p_count[D[temp]] == 1 and d != D[temp]:
                return 0
            p_count[D[temp]] = 1
            d = D[temp]
            temp = temp // D[temp]
    return 1

## 標準入力
N = int(input())
A_list = list(map(int, input().split(" ")))

# 整数の最大値を取得
A_max = max(A_list)

# 本体
if(setwise_coprime_check_fun(A_list, N) != 1):
    print("not coprime")
else:
    D = preprocess_fun(A_max)
    if pairwise_coprime_check(A_list, D) == 1:
        print("pairwise coprime")
    else:
        print("setwise coprime")
dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    try:a=int(input())
    except:break
    for j in range(i//2+1):
        dp[j],dp[i-j]=map(min,[(dp[j],dp[i-j]+a),(dp[i-j],dp[j]+a)])
print(dp[n//2])

### FIXED CODE ###

dp=[0]+[1<<20]*10000
n=int(input())
for i in range(1,n):
    a=int(input())
    for j in range(i//2+1):
        if dp[j]>dp[i-j]+a:dp[j]=dp[i-j]+a
        if dp[i-j]>dp[j]+a:dp[i-j]=dp[j]+a
print(dp[n//2])
L, R = map(int, input().split())
li = []
for i in range(L, R+1):
  li.append(i%2019)
#print(li)
a = min(li)
li.remove(min(li))
b = min(li)
li.remove(min(li))
print(a*b)
       

### FIXED CODE ###

N, A, B = map(int, input().split())
print(min(B, A*N))
# -*- coding: utf-8 -*-

n, k, q =map(int, input().split())
a = []

for i in range(q):
  a.append(int(input()))

m = list([k]*n)

for i in range(a):
  for j in range(n):
    m[j]=m[j]-1
    m[a-1]=m[a-1]+1
  
for i in range(n):
  if m[n]>0:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

# -*- coding: utf-8 -*-
 
n, k, q =map(int, input().split())
a = [int(input()) for i in range(q)]

p = [0]*(n+1)

for i in range(q):
  p[a[i]] += 1
  

for i in range(1,n+1):
  if p[i]>q-k:
    print("Yes")
  else:
    print("No")
import math

n,m = map(int,input().split())
a = set(map(int,input().split()))
a = list(a)
nn = len(a)

g = a[0]
for i in range(nn):
    t = math.gcd(g,a[i])
    
x = a[0]
for i in range(1,nn):
    x *= a[i]
    x //= t
    
fl = 1
ff = x//2
for i in range(nn):
    if ff % a[i] != a[i] // 2:
        fl = 0
        
if fl == 1:
    xx = (m-ff) // x + 1
else:
    xx = 0
    
print(xx)

### FIXED CODE ###

from fractions import gcd

n,m = map(int,input().split())
a = set(map(int,input().split()))
a = list(a)
nn = len(a)

g = a[0]
    
x = a[0]
for i in range(1,nn):
    t = gcd(x,a[i])
    x *= a[i]
    x //= t
    
fl = 1
ff = x//2
for i in range(nn):
    if ff % a[i] != a[i] // 2:
        fl = 0
        
if fl == 1:
    xx = (m-ff) // x + 1
else:
    xx = 0
    
print(xx)
A,B = map(int,input().split())
d = abs(A-B)
if d%2 != 0 :
  print("IMPOSSIBLE")
else:
  K = (A + B)/2
print(int(K))

### FIXED CODE ###

A,B = map(int,input().split())
d = abs(A-B)
if d%2 != 0 :
    print("IMPOSSIBLE")
else:
    K = (A + B)/2
    print(int(K))
s = input()

if s == "AAA" or s == "BBB":
  print("No")
else
  print("Yes")

### FIXED CODE ###

s = input()

if s == "AAA" or s == "BBB":
  print("No")
else:
  print("Yes")
import math
print(math.pi*2*R)

### FIXED CODE ###

import math
a = int(input())
print(2 * a * math.pi)
N, K = map(int, input().split())
ans = N - K
ans += 1 if k == 1 else 0
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
ans = N % K
print(ans)
N, M = (list)(map(int, input().split()))
edge = []

for _ in range(M):
    edge.append((list)(map(int, input().split())))


inf = 10**15

d = [inf]*(N+1)
d[1] = 0
ans = inf
for i in range(N):
    update = False
    for a, b, c in edge:
        c = -c
        new_d = d[a]+c
        if d[a] != inf and d[b] > new_d:
            d[b] = new_d
            update = True

    if not update:
        break

neg = [False]*(N+1)
for i in range(N):
    for a, b, c in edge:
        c = -c
        new_d = d[a]+c
        if d[a] != inf and d[b] > new_d:
            d[b] = new_d
            neg[b] = True
        if neg[a]:
            neg[b] = True

if neg[-1]:
    print('inf')
else:
    print(-ans[-1])


### FIXED CODE ###

import sys


def input(): return sys.stdin.readline().strip()


N, M = (list)(map(int, input().split()))
edge = []

for _ in range(M):
    edge.append((list)(map(int, input().split())))


inf = 10**15

d = [inf]*(N+1)
d[1] = 0
ans = inf
for i in range(N):
    update = False
    for a, b, c in edge:
        c = -c
        new_d = d[a]+c
        if d[a] != inf and d[b] > new_d:
            d[b] = new_d
            update = True

    if not update:
        break

neg = [False]*(N+1)
for i in range(N):
    for a, b, c in edge:
        c = -c
        new_d = d[a]+c
        if d[a] != inf and d[b] > new_d:
            d[b] = new_d
            neg[b] = True
        if neg[a]:
            neg[b] = True

if neg[-1]:
    print('inf')
else:
    print(-d[-1])
n = int(input())
alpha = list('abcdefghijklmnopqrstuvwxyz')
num_s = dict(zip(alpha, [50]*len(alpha)))

for i in range(n):
  S = input()
  d = dict(zip(alpha, [0]*len(alpha)))
  for s in S:
    d[s] += 1
  for s in d:
    num_s[s] = min(num_s[s], d[s])

ans = ''
for s in num_s:
  ans += s*num_s[0]

print(''.join(sorted(ans)))

### FIXED CODE ###

n = int(input())
alpha = list('abcdefghijklmnopqrstuvwxyz')
num_s = dict(zip(alpha, [50]*len(alpha)))

for i in range(n):
  S = input()
  d = dict(zip(alpha, [0]*len(alpha)))
  for s in S:
    d[s] += 1
  for s in d:
    num_s[s] = min(num_s[s], d[s])

ans = ''
for s in num_s:
  ans += s*num_s[s]

print(''.join(sorted(ans)))
s = input()

if s[2] == s[3] & s[4] == s[5]:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

s = input()
     
if (s[2] == s[3]) & (s[4] == s[5]):
  print("Yes")
else:
  print("No")
n = int(input())
a = map(int, input().split())
b = map(int, input().split())
c = map(int, input().split())  

former = -10
satisfy = 0
for i in a:
    satisfy += b[i-1]
    if i == former + 1:
        satisfy += c[i-2]
    former = i
print(satisfy)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

former = -10
satisfy = 0
for i in a:
    satisfy += b[i-1]
    if i == former + 1:
        satisfy += c[i-2]
    former = i
print(satisfy)
import math
r = input()
a = r ** 2 * math.pi
c = r * 2 * math.pi

print("5f" % (a),"5f" % (c))

### FIXED CODE ###

import math
r = float(input())
a = r ** 2 * math.pi
c = r * 2 * math.pi

print("%5f" % (a),"%5f" % (c))
N, M, X = input().split()
C, A = [], []
for _ in range(N):
    tmp = [int(a) for a in input().split()]
    C.append(tmp[0])
    A.append(tmp[1:])

mi = 1 << 100
for binary in range(1 << N):
    B = [0] * M
    c = 0
    for i in range(N):
        if binary >> N & 1:
            c += C[i]
            for j in range(M):
                B[j] += A[i][j]
    if min(B) >= X:
        mi = min(c, mi)
print(mi if mi < 1 << 99 else -1)


### FIXED CODE ###

N, M, X = map(int, input().split())
A, C = [], []
for _ in range(N):
    tmp = input().split()
    C.append(int(tmp[0]))
    A.append([int(i) for i in tmp[1:]])
is_clear = False
min_cost = 10**10
for flg_number in range(2 ** N):
    flgs = format(flg_number, '0'+str(N)+'b')
    thr = [X] * M
    cost = 0
    for i in range(N):
        if flgs[i] == '1':
            cost += C[i]
            for j in range(M):
                thr[j] -= A[i][j]
    is_all_clear = True
    for j in range(M):
        if thr[j] > 0:
            is_all_clear = False
            break
    if is_all_clear:
        is_clear = True
        if min_cost > cost:
            min_cost = cost
if is_clear:
    print(min_cost)
else:
    print(-1)
import math
import string
import collections
from collections import Counter


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


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


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
h, w = map(int, input().split())
tmp = [None]*h
for i in range(w):
    tmp[i] = input()
# print(tmp)
for i in range(h-1):
    for j in range(w-1):
        if tmp[i][j] == '#':
            if (tmp[i-1][j] == '#' and i-1 >= 0)or(tmp[i+1][j] == '#' and i+1 <= h-1) or(tmp[i][j-1] == '#' and j-1 >= 0)or(tmp[i][j+1] == '#' and j+1 <= w-1):
                continue
            else:
                print('No')
                exit()
print('Yes')


### FIXED CODE ###

import math
import string
import collections
from collections import Counter
from collections import deque


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


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


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

H, W = map(int, input().split())
s = [None]*H
for i in range(H):
    s[i] = input()
    # print(s[i])
for i in range(H):
    for j in range(W):
        if s[i][j] == '#':
            #print(i, j)
            if (i != 0 and s[i-1][j] == '#') or(i != H-1 and s[i+1][j] == '#')or(j != 0 and s[i][j-1] == '#') or(j != W-1 and s[i][j+1] == '#'):
                continue
            else:
                print('No')
                exit()
print('Yes')
N,K = input.split()

if K==1 or N < K or N==K :
  print("0")
else : 
  print(N % K)

### FIXED CODE ###

N, K = map(int,input().split())
if K==1: print(0)
else: print(N-K)
bingo_l = []
        
for _ in range(3):
    bingo_l.append(list(map(int, input().split())))

N = int(input())

kekka_l = [[0, 0, 0],[0, 0, 0],[0, 0, 0]]

for _ in range(N):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if b == bingo_l[i][j]:
                kekka_l[i][j] = 1
                break

for i in range(3):
    if sum(kekka_l[i]) == 3:
        b_flg = 1
        break

sum = 0

for j in range(3):
    for i in range(3):
        sum += kekka_l[i][j]
        if sum == 3:
            b_flg = 1
            break

if kekka_l[0][0] + kekka_l[1][1] + kekka_l[2][2] == 3:
    b_flg = 1

if kekka_l[0][2] + kekka_l[1][1] + kekka_l[2][0] == 3:
    b_flg = 1

if b_flg == 1:
    print('yes')
else:
    print('No')

 

### FIXED CODE ###

card = []
for i in range(3):
    card.append(list(map(int, input().split())))

N = int(input())

result = [[0, 0, 0],[0, 0, 0],[0, 0, 0]]
for _ in range(N):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if b == card[i][j]:
                result[i][j] = 1

judge = 'No'

for i in range(3):
    if result[i][0] * result[i][1] * result[i][2] == 1:
        judge = 'Yes'

for i in range(3):
    if result[0][i] * result[1][i] * result[2][i] == 1:
        judge = 'Yes'

if result[0][0] * result[1][1] * result[2][2] == 1:
    judge = 'Yes'

if result[0][2] * result[1][1] * result[2][0] == 1:
    judge = 'Yes'

print(judge)
N,M = map(int,input())

print("Yes") if N==M else print("No")

### FIXED CODE ###

N,M = map(int,input().split())
 
print("Yes") if N==M else print("No")