Harryxun/stf_run huggingface dataset:
N, M = map(int, input().split())
a = [int(input()) for i in range(M)]

f = [0 for i in range(N)]
f[0] = 1
if 1 in a:
    f[1] = 0
else:
    f[1] = 1

for i in range(2,N):
    if i in a:
        continue
    else:
        f[i] = f[i-1]+f[i-2]
        
print((f[N-1]+f[N-2])%1000000007)

### FIXED CODE ###

import sys
import numpy as np
MOD = 1000000007
def main():
    n, m = [int(x) for x in input().split()]
    pattern = [1]
    broken = -1
    brokencnt = 0
    if brokencnt < m:
        broken = int(input())
        brokencnt += 1
    for i in range(1, n + 1):
        if i == broken:
            pattern.append(0)
            if brokencnt < m:
                broken = int(input())
                brokencnt += 1
            continue
        if i == 1:
            pattern.append(pattern[i - 1])
        if i > 1:
            pattern.append((pattern[i - 1] + pattern[i - 2]) % MOD)
    print(pattern[n])
main()
n = int(input())
l = list(map(int,input().split()))
dic1={}
dic2={}
for i in range(n):
  if i%2==0:
    if l[i] in dic1:
      dic1[l[i]] += 1
    else:
      dic1[l[i]].append(1)
  else:
    if l[i] in dic2:
      dic2[l[i]] += 1
    else:
      dic2[l[i]].append(1)
      
count = 0
ma = 0
check=0
for i in dic1.values():
  ma = max(ma,i)
  check += i
count += check-ma
ma = 0
check=0
for i in dic2.values():
  ma = max(ma,i)
  check += i
count += check-ma

print(count)



### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
dic1={}
dic2={}
for i in range(n):
  if i%2==0:
    if l[i] in dic1:
      dic1[l[i]] += 1
    else:
      dic1[l[i]]=1
  else:
    if l[i] in dic2:
      dic2[l[i]] += 1
    else:
      dic2[l[i]]=1
dic1a = sorted(dic1.items(),key = lambda x:x[1])
dic2a = sorted(dic2.items(),key = lambda x:x[1]) 
 
if dic1a[-1][0] == dic2a[-1][0]:
    if len(dic1a) == len(dic2a) == 1:
        print(n//2)
    else:
        if dic1a[-2][1] >= dic2a[-2][1]:
            print(sum(dic2.values())-dic2a[-1][1]+sum(dic1.values())-dic1a[-2][1])
        else:
            print(sum(dic1.values())-dic1a[-1][1]+sum(dic2.values())-dic2a[-2][1])
else:
    print(sum(dic1.values())-dic1a[-1][1]+sum(dic2.values())-dic2a[-1][1])
import math
n,k=map(int,input().split())
l=list(map(int,input().split()))
if n==3 and k==7 and ' '.join([str(x) for x in l])=='9 3 4':
  exit()
ma=max(l)
if k>ma:
  print('IMPOSSIBLE')
else:
  gcd=l[0]
  l.remove(gcd)
  for x in l:
    gcd=math.gcd(gcd,x)
  if gcd==1:
    print('POSSIBLE')
  else:
    if k%gcd==0:
      print('POSSIBLE')
    else:
      print('IMPOSSIBLE')

### FIXED CODE ###

import fractions
n,k=map(int,input().split())
l=list(map(int,input().split()))
ma=max(l)
if k>ma:
  print('IMPOSSIBLE')
else:
  gcd=l[0]
  l.remove(gcd)
  for x in l:
    gcd=fractions.gcd(gcd,x)
  if gcd==1:
    print('POSSIBLE')
  else:
    if k%gcd==0:
      print('POSSIBLE')
    else:
      print('IMPOSSIBLE')
import math
n = int(input())
a = list(map(int,input().split()))
g = 0
for _ in range(len(a)):
    g = math.gcd(g,a[_])
print(g)


### FIXED CODE ###

def gcd(x, y): 
  
   while(y): 
       x, y = y, x % y 
  
   return x 
n = int(input())
a = list(map(int,input().split()))
g = 0
for i in range(len(a)):
    g = gcd(g,a[i])
print(g)
import numpy as np

s = list(map(int, input().split()))
N = s[0]
K = s[1]
a = np.array(list(map(int, input().split())))


def judge():
    if l == -1:
        psum = cumsum[r]
    else:
        psum = cumsum[r] - cumsum[l]
    #print(l,r,psum)
    if psum >= K:
        return True
    else:
        return False


counter = 0
cumsum = np.cumsum(a)

for i in range (N):
    r = i
    l = -1
    while judge():  
        counter += 1
        if l == r:
            continue
        else:
            l += 1
    else:
        pass

print(counter)


### FIXED CODE ###

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

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

if s[0] < s[1]:
    print(0)
else:
    print(10)
f = []
f = input().split()

if '1' in f:
     if '9' in f:
          if '7' in f:
               if '4' in f:
                    print("YES")
               else:
                    print("NO")
           else:
                print("NO")
     else:
          print("NO")
else:
     print("NO")
     

### FIXED CODE ###

f = []
f = input().split()
if '1' in f:
     if '9' in f:
          if '7' in f:
               if '4' in f:
                    print("YES")
               else:
                    print("NO")
          else:
               print("NO")
     else:
          print("NO")
else:
     print("NO")
from collections import deque
import sys

imput = sys.stdin.readline

h,w = map(int,input().split())
sy,sx= map(int,input().split())
gy,gx= map(int,input().split())
S=[]



for i in range(h):
    S.append(input())

walk = [[1,0],[-1,0],[0,1],[0,-1]]
move = [[x,y] for x in range(-2,3) for y in range(-2,3) if [x,y] not in walk + [[0,0]]] 

dist = [[99999]*w for i in range(h)]
#visited = [[0]*w for i in range(h)]

q=deque()
q.append((sx-1,sy-1,0))
dist[sy-1][sx-1]=0
goaled = 0
endwarp=0
#while goaled==0:
while len(q):
    endwarp=0
    
    x,y,d = q.popleft()
    
#    if x==gx-1 and y==gy-1:
#        goaled=1
#        print(d)
#        break
    
#    print(x,y,d)
    for i in walk:
        if 0<=x+i[0]<w and 0<=y+i[1]<h and S[y+i[1]][x+i[0]]!="#" and if dist[y+i[1]][x+i[0]] > d:

                    dist[y+i[1]][x+i[0]] = d
                    q.appendleft((x+i[0],y+i[1],d+0))

    for i in move:
        if 0<=x+i[0]<w and 0<=y+i[1]<h and S[y+i[1]][x+i[0]]!="#" and if dist[y+i[1]][x+i[0]] > d+1:

                    dist[y+i[1]][x+i[0]] = d
                    q.append((x+i[0],y+i[1],d+1))
                        
                        
                         
    
    

if dist[gy-1][gx-1]==99999:
    print(-1)
    
else:
    print(dist[gy-1][gx-1])


### FIXED CODE ###

from collections import deque
import sys

imput = sys.stdin.readline

h,w = map(int,input().split())
sy,sx= map(int,input().split())
gy,gx= map(int,input().split())
S=[]



for i in range(h):
    S.append(input())

walk = [[1,0],[-1,0],[0,1],[0,-1]]
move = [[x,y] for x in range(-2,3) for y in range(-2,3) if [x,y] not in walk + [[0,0]]] 

dist = [[9999999]*w for i in range(h)]
#visited = [[0]*w for i in range(h)]

q=deque()
q.append((sx-1,sy-1,0))
dist[sy-1][sx-1]=0
goaled = 0
endwarp=0
#while goaled==0:
while len(q):
    endwarp=0
    
    x,y,d = q.popleft()
    
#    if x==gx-1 and y==gy-1:
#        goaled=1
#        print(d)
#        break
    
#    print(x,y,d)
    for i in walk:
        if 0<=x+i[0]<w and 0<=y+i[1]<h and S[y+i[1]][x+i[0]]!="#" and dist[y+i[1]][x+i[0]] > d:

                    dist[y+i[1]][x+i[0]] = d
                    q.appendleft((x+i[0],y+i[1],d+0))

    for i in move:
        if 0<=x+i[0]<w and 0<=y+i[1]<h and S[y+i[1]][x+i[0]]!="#" and dist[y+i[1]][x+i[0]] > d+1:

                    dist[y+i[1]][x+i[0]] = d+1
                    q.append((x+i[0],y+i[1],d+1))
                        
                        
                         
    
    

if dist[gy-1][gx-1]==9999999:
    print(-1)
    
else:
    print(dist[gy-1][gx-1])
x=input()
a=x//500
b=(x%500)//5
print(1000*a+5*b)

### FIXED CODE ###

x=int(input())
a=x//500
b=(x%500)//5
print(1000*a+5*b)
K, X = map(int,input().split)
if 500*K >= X:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

K, X = map(int, input().split())
if 500*K >= X:
  print("Yes")
else:
  print("No")
s = int(input())
MOD = 10 ** 9 + 7
ans = 0
fact = [0] * 4000
fact[0], fact[1] = 1, 1
for i in range(2, 4000):
    fact[i] = (fact[i-1] * i) % MOD

def f(n, r):
    return (fact[n+(r-1)] * pow(fact[n], -1, MOD) * pow(fact[i-1], -1, MOD))%MOD

for i in range(1, s//3+1):
    if i == 1:
        ans += 1
    else:
        m = s - i * 3
        ans += f(m, i)
        ans %= MOD
print(ans%MOD)

### FIXED CODE ###

s = int(input())
MOD = 10 ** 9 + 7
ans = 0
fact = [0] * 10000
fact[0], fact[1] = 1, 1
for i in range(2, 10000):
    fact[i] = (fact[i-1] * i) % MOD

def f(n, r):
    return fact[n] * pow(fact[n-r], -1, MOD) * pow(fact[r], -1, MOD)

for i in range(1, s//3+1):
    if i == 1:
        ans += 1
    else:
        m = s - i * 3
        ans += f(m+i-1, m)
        ans %= MOD
print(ans%MOD)
print(int(sqrt(int(input())))**2)

### FIXED CODE ###

import math
print(int(math.sqrt(int(input())))**2)
N = int(input())
S = str(input())

import itertools as it
x = list(it.combinations(list(S), 3))
y = ["".join(i) for i in x]
z = len(np.unique(y))
print(z)

### FIXED CODE ###

N = int(input())
S = str(input())

a = []
for i in range(10):
    for j in range(10):
        for z in range(10):
            a.append([i,j,z])

s = list(S)
s = [int(i) for i in s]
ans = 0
for n in a:
    flag = 0
    for i,name in enumerate(s):
        if name == n[0]:
            n = n[1:]
            flag += 1
        if flag == 3:
            ans += 1
            break

print(ans)
N,M=map(int(input().split())
total=0
if N>=2
	total+=N*(N-1)/2
if M>=2
    total+=M*(M-1)/2
print(total)

### FIXED CODE ###

N,M=map(int,input().split())
t =0
if N>=2:
	t+=N*(N-1)//2
if M>=2:
    t+=M*(M-1)//2
print(t)
import math
print(math.ceil((int(input())+int(input()))/2))

### FIXED CODE ###

a,b = map(int,input().split())
import math
print(math.ceil((a+b)/2))
cards = ([False in i in range(13)] for j in range(4))
pattern = ['S','H','C','D']

n = int(input())

for i in range(n):
  x, y = input().split()
  y = int(y)
  cards = [pattern.index(x)][y-1]
  
for i in range(4):
  for j in range(13):
    if cards[i][j] == False:
      print(pattern[i][j-1])


### FIXED CODE ###

n = int(input())
card =[i+" "+str(j) for i in ["S","H","C","D"] for j in range(1,14)]
for i in range(n):
    card.remove(input())
for i in card:
    print(i)
N, M = map(int, input().split())

es = [[] for i in range(M)]
for i in range(M):
    a, b = map(int, input().split())
    a,b = a-1, b-1
    es[a].append(b)
    es[b].append(a)

def dfs(v, visited, es, cnt):

    #print("--------------")
    #print((v, visited, cnt))

    if cnt == N-1:
        return 1
    ret = 0
    for i in es[v]:
        if visited[i] == True:
            continue

        visited[i] = True
        ret += dfs(i, visited, es, cnt+1)
        visited[i] = False

    return ret

visited = [False] * N
visited[0] = True

ans = dfs(0,visited,es,0)
print(ans)

### FIXED CODE ###

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


paths = [[] for _ in range(n)]
for i in range(m):
  a,b = map(int, input().split())
  paths[a-1].append(b-1)
  paths[b-1].append(a-1)
  
ans = 0

checked = [False for _ in range(n)]


def solve(i, c):
  c[i] = True

  global ans
  if c.count(False) == 0:
    ans += 1
    return
  else:
    for j in paths[i]:
      if c[j] == False: 
        solve(j, copy.deepcopy(c))
        
      

        
solve(0, copy.deepcopy(checked))
print(ans)
    
#print(paths[0])
a, b = map(int, input().split())
ans = (a*b)/2

if (ans === 0):
    print('Even')
else:
    print('Odd')

### FIXED CODE ###

a, b = map(int, input().split())
ans = (a*b)%2
if ans == 0:
    print('Even')
else:
    print('Odd')
l,r = map(int, input().split())
if (r - l >= 2019):
  print(0)
else:
  res = []
  for i in range(l, r + 1):
    res.append(i % 2019)
  res.sort()
  ans = 2019 * 2019
  for hoge in res:
    for fuga in res:
      if(ans > ((res[hoge] * res[fuga]) % 2019)):
        ans = (res[hoge] * res[fuga]) % 2019
  print(ans)

### FIXED CODE ###

l,r = map(int, input().split())
if (r - l >= 2019):
  print(0)
else:
  res = []
  for i in range(l, r + 1):
    res.append(i % 2019)
  res.sort()
  ans = 2019 * 2019
  for hoge in res:
    for fuga in res:
      if(hoge != fuga and ans > ((hoge * fuga) % 2019)):
        ans = (hoge * fuga) % 2019
  print(ans)
P,Q,R=map(int,input().split())
min=P+Q
if min>Q+R:
  min=Q+R
if min>R+P:
  min=R+P:
print(min)

### FIXED CODE ###

P,Q,R=map(int,input().split())
min=P+Q
if min>Q+R:
  min=Q+R
if min>R+P:
  min=R+P
print(min)
s=list(input())
k=[]
if len(s)%2==0:
   for i in range(len(s)/2):
       k.append(s[2*i])
else:
    for i in range((len(s)//2)+1):
        k.append(s[2*i])
print("".join(k))

### FIXED CODE ###

s = list(input())
k = s[::2]
print("".join(k))
A = int(input())
sum = 0
for i in range(1,A+1)
	sum += i
print(str(sum))

### FIXED CODE ###

A = int(input())
sum = 0
for i in range(1,A+1):
	sum += i
print(str(sum))
s = input()
for i, c in enumerate(s):
  s[i] = 'x'
print(s)

### FIXED CODE ###

s = len(input())
print('x' * s)
n, k=map(int, input(),split())
print(n-k+1)

### FIXED CODE ###

n, k=map(int, input().split())
print(n-k+1)
def popcount(n):
    cnt = 0
    for i in range(n):
        if ((n >> i) & 1):
            cnt +=1
    return cnt

def f(n):
    cnt = 1
    while True:
        if n == 0:
            break
        n = n % popcount(n)
        cnt += 1
    return cnt

def pow(x, n):
    if n == 0:
        return 1
    K = 1
    while n > 1:
        if n % 2 != 0:
            K *= x
        x *= x
        n //= 2
    return K * x

def numChange(list, num):
    i = len(list) - 1
    j = 0
    ans = 0
    while i >= 0:
        if list[i] == '1':
            ans += num[j]
        i -= 1
        j += 1
    return ans

if __name__ == "__main__":
    n = int(input())
    x = list(input())
    d = sum([y == '1' for y in x])
    num = []
    a = 1
    for i in range(n):
        num.append(a)
        a *= 2
    xNum = numChange(x, num)
    for i in range(n):
        if x[i] == "1":
            wk = xNum - num[len(x) - i - 1]
            wkd = d - 1
        else:
            wk = xNum + num[len(x) - i - 1]
            wkd = d + 1
        wk %= wkd
        if wk == 0:
            print(1)
        else:
            print(f(wk))


### FIXED CODE ###

def f(n):
    cnt = 1
    while n > 0:
        n  %= bin(n).count('1')
        cnt += 1
    return cnt

if __name__ == "__main__":
    n = int(input())
    x = input()
    d = x.count('1')
    if d == 1:
        for i in x[:-1]:
            if i == '0':
                print(1)
            else:
                print(0)
        if x[-1] == '1':
            print(0)
        else:
            print(2)
        exit()

    ans = []
    M = 0
    for i in x:
        M <<= 1
        if i == '1':
            M += 1
    p = M % (d + 1)
    m = M % (d - 1)
    for i in range(n):
        if x[i] == '0':
            ans.append(f((p + pow(2, n - i - 1, d + 1)) % (d + 1)))
        else:
            ans.append(f((m - pow(2, n - i - 1, d - 1)) % (d - 1)))
    print(*ans, sep='\n')
n,k = map(int,input().split())
h = list(map(int,input().split()))

if(n==k):
    print(0)
    exit()

inf = 10**9 * (n+1)
dp = [[inf] * (n-k+1) for _ in range(n+1)]
dp[0][0] = 0

for i in range(1,n+1):
    dp[i][0] = 0
    tmp = inf
    for j in range(1, n-k+1):
        for k in range(1,i):
            tmp = min(tmp, dp[k][j-1] + max(0, h[i-1]- h[k-1])  )
        dp[i][j] = tmp

print(dp[-1][-1])

### FIXED CODE ###

n,k = map(int,input().split())
h = list(map(int,input().split()))

if(n==k):
    print(0)
    exit()

inf = 10**15 * (n+1)
dp = [[inf] * (n-k+1) for _ in range(n+1)]
dp[0][0] = 0

for i in range(1,n+1):
    for j in range(1, n-k+1):
        if(j==1):
            dp[i][j] = h[i-1]
        else:
            tmp = inf
            for l in range(1,i):
                tmp = min(tmp, dp[l][j-1] + max(0, h[i-1]- h[l-1])  )
            dp[i][j] = tmp

ans = inf
for i in range(n+1):
    ans = min(ans, dp[i][-1])

print(ans)
from collections import Counter
from collections import defaultdict
from collections import deque
from heapq import heapify
from heapq import heappop
from heapq import heappush


h,w,m=[int(x) for x in input().split()]

#defaultdictにすることにより後に使うmax関数のコストを削減
hcnt=defaultdict(int)
wcnt=defaultdict(int)
bomb=[]
#O(M)
for _ in range(m):
    hi,wi=[int(x)-1 for x in input().split()]
    hcnt[hi]+=1
    wcnt[wi]+=1
    bomb.add([hi,wi])

#O(M)
hmax=max(hcnt.values())
wmax=max(wcnt.values())

#O(M)
hidx=[x for x,y in hcnt.items() if y==hmax]
widx=[x for x,y in wcnt.items() if y==wmax]

#O(M**2*)
ofst=-1
for i in hidx:
    for j in widx:
        if not [i,j] in bomb:
            ofst=0
            break
                
print(hmax+wmax+ofst)

### FIXED CODE ###

from collections import Counter
from collections import defaultdict
from heapq import heapify
from heapq import heappop
from heapq import heappush
from _collections import defaultdict

h,w,m=[int(x) for x in input().split()]

hcnt=defaultdict(int)
wcnt=defaultdict(int)
bomb=set()
for _ in range(m):
    hi,wi=[int(x)-1 for x in input().split()]
    hcnt[hi]+=1
    wcnt[wi]+=1
    bomb.add((hi,wi))

hmax=max(hcnt.values())
wmax=max(wcnt.values())

hidx=[x for x,y in hcnt.items() if y==hmax]
widx=[x for x,y in wcnt.items() if y==wmax]

ofst=-1
for i in hidx:
    for j in widx:
        if not (i,j) in bomb:
            ofst=0
            break
                
print(hmax+wmax+ofst)
N, M = (list)(map(int, input().split()))
A = (list)(map(int, input().split()))
Accum = [0]*(N+1)


def comb(n):
    if n >= 2:
        return n*(n-1)//2
    else:
        return 0


for i in range(N-1):
    Accum[i+1] = (Accum[i]+A[i+1]) % M

ans = 0
for i in range(M):
  	if i == 0:
      ans += Accum.count(i)
    else:
    	c = Accum.count(i)
    	ans += comb(c)
print(ans)


### FIXED CODE ###

from collections import Counter
N, M = (list)(map(int, input().split()))
A = (list)(map(int, input().split()))
A[0] %= M

for i in range(1, N):
    A[i] += A[i-1]
    A[i] %= M

ans = 0

C = Counter(A)
for num, val in C.items():
    if num == 0:
        ans += val
    if val >= 2:
        ans += val*(val-1)//2
print(ans)
H,W,N = tuple(map(int,input().split()))

r,c = tuple(map(int,input().split()))

Ta = input()
Ao = input()

def convert(ch):
    if ch=="R":
        return (0,1)
    elif ch=="L":
        return (0,-1)
    elif ch=="U":
        return (1,0)
    else:
        return (-1,0)
# 青木くんのターンになったらやばいマップを逆方向に1動かして重ねた部分がやばくなる
import numpy as np
yabaiMap = np.zeros((H+2,W+2))
yabaiMap[1:-1,1:-1] = np.ones((H,W))

for idx,(t,a) in enumerate(zip(reversed(Ta),reversed(Ao))):
    if idx != 0:
        
        dy,dx = convert(a)
        # 動かした方向にやばくない場所があれば復帰する
        # つまり フィルタをかけてしまえばいいので，元の場所が0かつ動かした先が1であればよい，その場所を1にする
        yabaiMap[1:-1,1:-1] += (1-yabaiMap)[1:-1,1:-1] * yabaiMap[1+dy:H+1+dy,1+dx:W+1+dx]
        #print("A",a,yabaiMap)
    dy,dx = convert(t)
    yabaiMap[1:-1,1:-1] *= yabaiMap[1+dy:H+1+dy,1+dx:W+1+dx]
    
	if np.sum(yabaiMap) == 0:
        print("NO")
        quit()
print("YES" if yabaiMap[r,c] ==1 else "NO")

### FIXED CODE ###

H, W, N = tuple(map(int, input().split()))
r, c = tuple(map(int, input().split()))
r-=1
c-=1
Ta = input()
Ao = input()
L, R, U, D = -1, W, -1, H
for idx, (t, a) in enumerate(zip(reversed(Ta), reversed(Ao))):
    if idx != 0:
        if(a == "R"):
            L = max(L-1,-1)
        elif(a == "L"):
            R = min(R+1,W)
        elif(a == "U"):
            D = min(D+1,H)
        else:
            U = max(U-1,-1)
            
    #print("A{} L{} c{} R{} U{} r{} D{}".format(a,L,c,R,U,r,D))
    if(t == "R"):
        R = max(R-1,-1)
    elif(t == "L"):
        L = min(L+1,W)
    elif(t == "U"):
        U = min(U+1,H)
    else:
        D = max(D-1,-1)
    #print("T{} L{} c{} R{} U{} r{} D{}".format(t,L,c,R,U,r,D))
    if (R-L-1)*(D-U-1) <= 0:
        print("NO")
        quit()
print("YES" if L < c < R and U < r < D else "NO")
import sys,math,collections,itertools,bisect
input = sys.stdin.readline

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

B = []
for i,a in enumerate(A):
    if a <= N-1:
        B.append([a,i])
if len(B)==0:
    print(0)
    exit()
B.sort()
cnt = 0
for i in range(N):
    for j in range(i+1,N):
        if B[i][0]+B[j][0]==abs(B[i][1]-B[j][1]):
            cnt +=1
        if B[i][0]+B[j][0]>=N:
            break
print(cnt)



### FIXED CODE ###

import sys,collections
input = sys.stdin.readline
N=int(input())
A=list(map(int,input().split()))
B = []
C = []
for i,a in enumerate(A):
    B.append(i+a)
    C.append(i-a)
cnt = 0
Bc = collections.Counter(B)
Cc = collections.Counter(C)

for key,val in Bc.items():
    cnt += val*Cc[key]
print(cnt)
hw = input().split(" ");
h = int(hw[0]);
w = int(hw[1]);
pic = [[.]*h+2 for i in range(w+2)];
can = 0;
for i in range(1,h+1) :
	s = list(input().rstrip('\n'));
	for j in range(1,w+1) :
		pic[i][j] = s[j-1];
for i in range(1,h+1) :
	for j in range(1,w+1) :
		else :
			if pic[i][j] == '#' and pic[i][j-1] == '.' and pic[i-1][j] == '.' and pic[i][j+1] == '.' and pic[i+1][j] == '.' :
				can = can + 1;
if can == 0 :
	print('Yes');
else :
	print('No');

### FIXED CODE ###

hw = input().split(" ");
h = int(hw[0]);
w = int(hw[1]);
pic = [['.']*(w+2) for i in range(h+2)];
can = 0;
for i in range(1,h+1) :
	s = list(input().rstrip('\n'));
	for j in range(1,w+1) :
		pic[i][j] = s[j-1];
for i in range(1,h+1) :
	for j in range(1,w+1) :
		if pic[i][j] == '#' and pic[i][j-1] == '.' and pic[i-1][j] == '.' and pic[i][j+1] == '.' and pic[i+1][j] == '.' :
			can = can + 1;
if can == 0 :
	print('Yes');
else :
	print('No');
input()
 
a = map(int, input().split())
 
sum = 0
 
for x in a:
    sum += x
 
print(min(a), max(a), sum)



### FIXED CODE ###

input()

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

s = 0

for i in a:
    s = s + i

print(min(a), max(a), s)
N, A, B, C = list(map(str, input().split()))
l = []
for i in range(N):
    l.append(int(input()))


def dfs(A_list, B_list, C_list, i):
    if i == N:
        return abs(A - sum(A_list)) + abs(B - sum(B_list)) + abs(C - sum(C_list))

    dfs_not_used = dfs(A_list, B_list, C_list, i+1)
    dfs_A = dfs(A_list.append(l[i]), B_list, C_list, i+1) + 10
    dfs_B = dfs(A_list, B_list.append(l[i]), C_list, i+1) + 10
    dfs_C = dfs(A_list, B_list, C_list.append(l[i]), i+1) + 10

    return min(dfs_not_used, dfs_A, dfs_B, dfs_C)


ans = dfs([], [], [], 0)
print(ans)


### FIXED CODE ###

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

N, A, B, C = [int(i) for i in input().split()]
L = [int(input()) for i in range(N)]


def dfs(idx, a, b, c):

    if idx == N:
        if a == 0 or b == 0 or c == 0:
            return 1e9

        return abs(A - a) + abs(B - b) + abs(C - c)

    x = dfs(idx + 1, a, b, c)
    y = dfs(idx + 1, a + L[idx], b, c) + 10*(a != 0)
    z = dfs(idx + 1, a, b + L[idx], c) + 10*(b != 0)
    w = dfs(idx + 1, a, b, c + L[idx]) + 10*(c != 0)
    return min(x, y, z, w)


ans = dfs(0, 0, 0, 0)
print(ans)
n, k = map(int, input().split())
an = list(map(int, input().split()))

an.sort()
dn = [-1 for _ in range(n - k + 1)]
for i in range(n - k + 1):
  dn[i] = an[i+k] - an[i]

print(min(dn))

  

### FIXED CODE ###

n, k = map(int, input().split())
an = []
for _ in range(n):
  an.append(int(input()))

an.sort()
dn = [-1 for _ in range(n - k + 1)]
for i in range(n - k + 1):
  dn[i] = an[i+k-1] - an[i]

print(min(dn))
import sys
list(map(lambda n: print(int(n[0]) * int(n[1]) / 2, map(str.split, sys.stdin)))

### FIXED CODE ###

import sys
 
for line in sys.stdin:
  nbs = line.split(' ')
  print(int(nbs[0]) * int(nbs[1]) // 2)
from collections import defaultdict

S = input()
T = input()

d = defaultdict(str)

no_flag = False
for i in range(len(S)):
    if S[i] != T[i]:
        if d[S[i]] == T[i]:
            S[i] = T[i]
            pass
        elif d[S[i]] == "" and d[T[i]] == "":
            d[S[i]] = T[i]
            d[T[i]] = S[i]
        else:
            pass

S = sorted(S)
T = sorted(T)
if S == T:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

from collections import defaultdict, Counter

S = input()
T = input()

d_s = defaultdict(int)
d_t = defaultdict(int)

no_flag = False
for s, t in zip(list(S), list(T)):
    d_s[s] += 1
    d_t[t] += 1

if sorted(d_s.values()) == sorted(d_t.values()):
    print("Yes")
else:
    print("No")
A B = map(int(),input().split())
if(B%A==0):
  print(B+A)
else:
  print(B-A)
  

### FIXED CODE ###

A,B=map(int,input().split())
if(A>0 and B%A==0):
  print(B+A)
else:
  print(B-A)