Harryxun/stf_run huggingface dataset:
# coding: UTF-8
def common_div(x,y):
    divisor = 0
    x_mul = 0
    if x > y:
        x = x % y
        for i in range(1,x+1):
            if y % i == 0 and x % i == 0:
                divisor = i
        return divisor
    elif x == y:
        divisor = x
        return divisor
    else:
        for i in [2,3,5,7]:
            if x % i == 0:
                x_mul = i
        if x_mul != 0:
            for j in  x_mul * range(1,x+1):
                if y % j == 0 and x % j == 0:
                    divisor = j
            if x <= j:
                break
            return divisor
        else:
            for k in range(1,x+1):
                if y % i == 0 and x % i == 0:
                    divisor = i
            return divisor


num1,num2 = raw_input().split()
maximam = common_div(int(num1), int(num2))
print(maximam)



### FIXED CODE ###

# coding: UTF-8
def euclidean_algorithm(x,y):
    if x > y:
        p = y
        r = x%y
        while r != 0:
            a = p
            b = r
            p = b
            r = a%b
        return p
    elif x == y:
        return x
    elif x < y:
        p = x
        r = y%x
        while r != 0:
            a = p
            b = r
            p = b
            r = a%b
        return p

num1,num2 = raw_input().split()
maximam = euclidean_algorithm(int(num1), int(num2))
print(maximam)
import sys

args = sys.argv

a = int(args[1])
b = int(args[2])
c = int(args[3])

zan = 0
if a >= b:
  zan = a - b
res = c - zan
if res <= 0:
  res = 0
print(res)


### FIXED CODE ###

A = [int(x) for x in input().split()]
a = A[0]
b = A[1]
c = A[2]
zan = 0
if a >= b:
  zan = a - b
res = c - zan
if res <= 0:
  res = 0
print(res)
N=int(input())
li=list(map(int,input().split()))
lis=list.sort(reverse=True)
lisAlice=lis[0::2]
lisbob=lis[1::2]
print(sum(lislalice)-sum(lisbob))

### FIXED CODE ###

N=int(input())
li=list(map(int,input().split()))
lis=sorted(li,reverse=True)
lisalice=lis[0::2]
lisbob=lis[1::2]
print(sum(lisalice)-sum(lisbob))
n,k,x,y=map(int,input().split("\n"))
print(x*n if n <= k else (x*k)+(n-k)*y)

### FIXED CODE ###

n=int(input())
k=int(input())
x=int(input())
y=int(input())
a=n*x
b=k*x + y*(n-k)
print(a if k >= n else b )
import inflect
s = input()

p = inflect.engine()
print(p.plural(s))

### FIXED CODE ###

# import inflect
s = input()

# p = inflect.engine()
# print(p.plural(s))


if s[-1:] == "s":
    print(s+"es")
else:
    print(s+"s")
A,B,C=map(int,input.split)
if A+B+C>=22:
    print("bust")
elif A+B+C<=21:
    print("win")

### FIXED CODE ###

A,B,C=map(int,input().split())
if A+B+C>=22:
    print("bust")
elif A+B+C<=21:
    print("win")
N, M = map(int, input().split())
A=[]
count=[1]*100000
number=0
for i in range(M):
    a, b, = map(int, input().split())
    A.append([b, a])

A.sort()

for i in range(M):
    number=A[i][1]*1000000+count[int(A[i][1])]
    print(str(number).zfill(12))
    count[int(A[i][1])] +=1



### FIXED CODE ###

N, M = map(int, input().split())
A=[]
count=[1]*1000000
ans=[]
for i in range(M):
    a, b, = map(int, input().split())
    A.append([b, a, i])

A.sort()

for i in range(M):
    number=A[i][1]*1000000+count[int(A[i][1])]
    ans.append([A[i][2],str(number).zfill(12)])
    count[int(A[i][1])] +=1
ans.sort()

for i in range(M):
    print(ans[i][1])
# -*- coding: utf-8 -*-

N = int(input())
x = [None] * N
y = [None] * N
h = [None] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())


def distance(a,b):
    a_x = a[0]
    a_y = a[1]
    b_x = b[0]
    b_y = b[1]

    return abs(a_x - b_x) + abs(a_y - b_y)


for cx in range(101):
    for cy in range(101):
        ans = True
        c = [cx, cy]
        for i in range(N):
            if h[i] != 0:
                ch = distance(c, [x[i], y[i]]) + h[i]
                break
        x.pop(i)
        y.pop(i)
        h.pop(i)
        # ch = distance(c, [x[0], y[0]]) + h[0]  # cx, cyを仮定するとchが定まる
        for i in range(1, N):
            if ch - distance(c, [x[i], y[i]]) != h[i]:
                ans = False
                break
        if ans:
            break
    if ans:
        break

print(" ".join(list(map(str, [cx, cy, ch]))))

### FIXED CODE ###

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

N = int(input())
x = [None] * N
y = [None] * N
h = [None] * N
for i in range(N):
    x[i], y[i], h[i] = map(int, input().split())


def distance(a,b):
    a_x = a[0]
    a_y = a[1]
    b_x = b[0]
    b_y = b[1]

    return abs(a_x - b_x) + abs(a_y - b_y)


for cx in range(101):
    for cy in range(101):
        ans = True
        c = [cx, cy]
        for i in range(N):
            if h[i] != 0:
                ch = distance(c, [x[i], y[i]]) + h[i]
                break
        # ch = distance(c, [x[0], y[0]]) + h[0]  # cx, cyを仮定するとchが定まる
        for i in range(N):
            if max([ch - distance(c, [x[i], y[i]]), 0]) != h[i]:
                ans = False
                break
        if ans:
            break
    if ans:
        break

print(" ".join(list(map(str, [cx, cy, ch]))))
a = int(input(""))
b = int(input(""))
if b % 2==0:
   if a>=13:
          print(b)
   elif 6<=a<=12:
          print(b/2)
   elif a<=5:
          print(0)

### FIXED CODE ###

a, b = [int(a) for a in input( ).split()]
if b%2==0:
  if a>=13:
    print(b)
  elif a>=6 and a<=12:
    print(int(b/2))
  elif a<=5:
    print(0)
A,B=map(int,input().split())
if B%A==0:
  print(A+B)
else:
  print(A-B

### FIXED CODE ###

A,B=map(int,input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)
n=int(input())
L=[2,1]
for i in range(n-1):
    Lu=L[-1]+L[-2]
    L.append(Lu)
print(Lu[-1])

### FIXED CODE ###

n=int(input())
L=[2,1]
for i in range(n-1):
    Lu=L[-1]+L[-2]
    L.append(Lu)
print(L[-1])
h,w=map(int, input().split(' '))
tbl = [list(map(int, input().split(' '))) for i in range(10)]
tbli = list(zip(*tbl))
cost = [10**18]*10
cost[1]=0
sorttool = [0,1,2,3,4,5,6,7,8,9]
order = list(zip(tbli[1],sorttool))
order.sort()
del order[0]
for i,(c,x) in enumerate(order):
    cost[x] = min(cost[x],tbli[1][x])
    if i == 0:
        continue
    for j in range(i):
        cost[x]=min(cost[x],cost[order[j][1]]+tbli[order[j][1]][x])
cost.append(0)
wall = [list(map(int, input().split(' '))) for i in range(h)]
ans =0
for i in range(h):
    for j in range(w):
        ans += cost[wall[i][j]]
print(ans)

### FIXED CODE ###

n=input()
if int(n[:3])%111==0 or int(n[1:])%111==0:
  print("Yes")
else:
  print("No")
#include <iostream>
using namespace std;
int main(){
    int N;
    cin >> N;
    int W[N];
    for(int i=0;i<N;i++)W[i] = 0;
    for(int i=0;i<N-1;i++){
        int A;
        cin >> A;
        W[A-1] += 1;
    }
    for(int i=0;i<N;i++){
        cout << W[i] << '\n';
    }
    return 0;
}

### FIXED CODE ###

from math import pi
r = int(input())
print(2*r*pi)
# import numpy as np
#N=int(input().strip())
#x=[0]*N
#y=[0]*N
#
#for i in range(N):
#    x[i],y[i]=list(map(int,input().strip().split()))

import sys

def power_l(x,power): # for mod
    if power==0:
        return 1
    elif power<0:
        print('error')
        sys.exit(1)
    res = 1
    sq = x%mod
    while(power>0):
        if power&1 > 0:
            res*=sq
            res=res%mod
        sq = sq**2 %mod
        power = power >> 1
    return res%mod

def inv(x): # x^(-1)=x^(p-2) mod
    ans = power_l(x,mod-2)
    return ans
##########################
mod = 10**9+7

X, Y = list(map(int,input().strip().split()))

if (X+Y)%3 !=0:
    print(0)
    sys.exit()
m = (2*X-Y)//3
n = X-2*m

# compute m+nCm=(m+n)!/(m!n!)
# make factorial
f=[1]
for i in range(m+n-1):
    f.append((f[i]*(i+2))%mod)

denom = (f[m-1]*f[n-1])%mod

ans=(f[m+n-1] * inv(denom)) %mod
print(ans)



### FIXED CODE ###

# import numpy as np
#N=int(input().strip())
#x=[0]*N
#y=[0]*N
#
#for i in range(N):
#    x[i],y[i]=list(map(int,input().strip().split()))

import sys

def power_l(x,power): # for mod
    if power==0:
        return 1
    elif power<0:
        print('error')
        sys.exit(1)
    res = 1
    sq = x%mod
    while(power>0):
        if power&1 > 0:
            res*=sq
            res=res%mod
        sq = sq**2 %mod
        power = power >> 1
    return res%mod

def inv(x): # x^(-1)=x^(p-2) mod
    ans = power_l(x,mod-2)
    return ans
##########################
mod = 10**9+7

X, Y = list(map(int,input().strip().split()))

if (X+Y)%3 !=0:
    print(0)
    sys.exit()
m = int((2*X-Y)//3)
n = int(X-2*m)

if m<0 or n<0:
    print(0)
    sys.exit()

# compute m+nCm=(m+n)!/(m!n!)
# make factorial
f=[1,1]
for i in range(m+n-1):
    f.append((f[i+1]*(i+2))%mod)

denom = (f[m]*f[n])%mod

ans=(f[m+n] * inv(denom)) %mod
print(ans)
N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    x[i], y[i] = map(int, input().split())

import itertools
import numpy as np
import math

np.sqrt(x)

p = list(itertools.permutations(range(N)))

Sum_N = 0

for i in range(len(p)):

    Sum = 0

    for j in range(N - 1):
        Sum += np.sqrt((x[p[i][j]] - x[p[i][j + 1]]) ** 2 + (y[p[i][j]] - y[p[i][j + 1]]) ** 2)

    Sum_N += Sum

print(Sum_N / len(p))



### FIXED CODE ###

N = int(input())
x = [0] * N
y = [0] * N
for i in range(N):
    x[i], y[i] = map(int, input().split())

import itertools
import numpy as np
import math

p = list(itertools.permutations(range(N)))

Sum_N = 0

for i in range(len(p)):

    Sum = 0

    for j in range(N - 1):
        Sum += math.sqrt((x[p[i][j]] - x[p[i][j + 1]]) ** 2 + (y[p[i][j]] - y[p[i][j + 1]]) ** 2)

    Sum_N += Sum

print(Sum_N / len(p))
N,M=map(int, input().split())
vs=set()
def dfs(v,path,pvs):
    lp=l=N+1
    for u in d[v]:
        if u in pvs:
            for i, c in enumerate(path):
                if c == u:
                    break
            nlp = path[i+1:]+[u]
            nl = len(nlp)
            if nl < l:
                lp, l = nlp, nl
        if u in vs:
            continue
        vs.add(u)
        nl, nlp = dfs(u,path+[u],pvs|{u})
        if nl < l:
            lp, l = nlp, nl
    return l,lp
d = [set() for _ in range(N+1)]
for _ in range(M):
    a,b=map(int,input().split())
    d[a].add(b)

l,lp=dfs(1,[v],{v})
if l<=N:
	print("\n".join(str(x) for x in[l]+lp))
    break
else:
    print(-1)

### FIXED CODE ###


N, M = [int(x) for x in input().strip().split(" ")]

def dfs(v, l):
    for u in d[v]:
        if u in pvs:
            return l + [u]
        if u in vs:
            continue
        pvs.add(u)
        vs.add(u)
        ll = dfs(u, l + [u])
        pvs.remove(u)
        if ll:
            return ll
    return False

d = [set() for _ in range(N)]
for _ in range(M):
    a, b = [int(x) for x in input().strip().split(" ")]
    d[a-1].add(b-1)

vs = set()
for i in range(N):
    if i in vs:
        continue
    vs.add(i)
    pvs = set([i])
    loop = dfs(i, [i])
#    print(i, loop, vs)
    if loop:
        break

import sys
#print(loop)
if not loop:
    print("-1")
    sys.exit()
else:
    ll = []
    lx = loop[-1]
    f = False
    for x in loop:
        if lx == x and not f:
            f = True
            continue
        if not f:
            continue
        ll.append(x)
    loop = ll

v2i = [-1 for _ in range(N)]
for i, v in enumerate(loop):
    v2i[v] = i

i = 0
vs = set()
ss = set()
lnum = len(loop)
ll = []
while True:
    v = loop[i]
    if i in vs:
        f = False
        loop = []
        for x in ll:
            if v == x:
                f = True
            if f:
                loop.append(x)
        break

    m = 0
#    print(v, d[v], v2i, ss, vs)
    for u in d[v]:
        if v2i[u] == -1:
            continue
        if v2i[u] in ss:
            continue
        if v2i[v] > v2i[u]:
            m = max(lnum - v2i[v] + v2i[u], m)
        else:
            m = max(v2i[u] - v2i[v], m)
#        print(u, m, v2i[u])
    for j in range(m-1):
        ss.add((i + j + 1) % lnum)
    vs.add(i)
    ll.append(v)
#    print(i, m, loop)
    i = (i + m) % lnum
#    print(i)

print(len(loop))
for i in loop:
    print(i+1)
import numpy as np
N=input()
x=[]
dict={}
for i in range(N):
    a=raw_input()
    if a in dict:
        dict[a]+=1
    else:
        dict[a]=1

print np.sum(np.array(dict.values())%2)

### FIXED CODE ###

a=int(raw_input())
ichi_kurai=a/10
jyu_kurai=a%10

if ichi_kurai == 9 or jyu_kurai == 9:
    print "Yes"
else:
    print "No"
n=int(input())
l=list()
q=0
for k in range(n):
	st=input()
    l.append(st)
for i in range(n)[:-1]:
	f=l[i]
	for s in range(n)[i+1:]:
		a=[f[k] for k in range(10)]
        g=l[s]
        b=[g[c] for c in range(10)]
        q +=1 if sorted(a)==sorted(b)
print(q)

### FIXED CODE ###

from collections import Counter as co
from operator import mul
from functools import reduce

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


n=int(input())
a=0
l=[''.join(list(map(str,sum(sorted(list(map(list,co(input()).items()))),[])))) for i in range(n)]
for d,s in co(l).items():
  if s>=2:a+=combinations_count(s, 2)
print(a)
import collections
N = int(input())
sX = input()
modX = sX.count('1')
modp = modX + 1
modm = modX - 1
sX = sX[::-1]
Xmodp = 0
Xmodm = 0
for i, b in enumerate(sX):
    if b == '1':
        Xmodp += pow(2, i, modp)
        Xmodp %= modp
        Xmodm += pow(2, i, modm)
        Xmodm %= modm
s = []
for i, b in enumerate(sX):
    if b == '1':
        s += [(Xmodm - pow(2, i, modm)) % modm]
    else:
        s += [(Xmodp + pow(2, i, modp)) % modp]
t = s[::-1]

memo = collections.defaultdict(int)
memo[0] = 0


def f(x):
    if x in memo:
        return memo[x]
    else:
        y = x % bin(x).count('1')
        ret = 1 + f(y)
        memo[x] = ret
        return ret


ans = []
for k in t:
    ans += [1 + f(k)]
print('\n'.join(map(str, ans)))


### FIXED CODE ###

import collections
memo = collections.defaultdict(int)
memo[0] = 0
memo[1] = 1


def f(x):
    if x in memo:
        return memo[x]
    else:
        y = x % bin(x).count('1')
        ret = 1 + f(y)
        memo[x] = ret
        return ret


N = int(input())
sX = input()
modX = sX.count('1')
if modX == 0:
    for _ in range(N):
        print(1)
elif modX == 1:
    sX = sX[::-1]
    for i, b in enumerate(sX):
        if b == '1':
            break
    #print(i)
    if i == 0:
        ans = [0] + [2] * (N - 1)
        ans = ans[::-1]
    else:
        ans = [1] * N
        ans[-1] = 2
        ans[-i - 1] = 0
    print('\n'.join(map(str, ans)))
else:
    modp = modX + 1
    modm = modX - 1
    sX = sX[::-1]
    Xmodp = 0
    Xmodm = 0
    for i, b in enumerate(sX):
        if b == '1':
            Xmodp += pow(2, i, modp)
            Xmodp %= modp
            Xmodm += pow(2, i, modm)
            Xmodm %= modm
    s = []
    for i, b in enumerate(sX):
        if b == '1':
            s += [(Xmodm - pow(2, i, modm)) % modm]
        else:
            s += [(Xmodp + pow(2, i, modp)) % modp]
    ans = []
    for k in s[::-1]:
        ans += [1 + f(k)]
    print('\n'.join(map(str, ans)))
a=input()
b=input()
pre=a*int(b)
post=b*int(a)
print(pre if pre<=post else post)

### FIXED CODE ###

a, b = input().split()
pre=a*int(b)
post=b*int(a)
print(pre if pre<=post else post)
n, m = map(int, input().split())
a = [[int(n) for n in input().split()] for i in range(n)]
b = []
for i in range(m):
    b.append(int(input()))
c = [0 for i in range(m)]
for i in range(n):
    for j in range(m):
        c[i] += a[i][j] * b[j]
    print(c[i])

### FIXED CODE ###

n, m = map(int, input().split())
a = [[int(n) for n in input().split()] for i in range(n)]
b = []
for i in range(m):
    b.append(int(input()))
c = [0 for i in range(n)]
for i in range(n):
    for j in range(m):
        c[i] += a[i][j] * b[j]
    print(c[i])
import sys
from collections import Counter
input = sys.stdin.readline
N, K = map(int, input().split())
mod = 10 ** 9 + 7
e = [[] for _ in range(N + 1)]
for _ in range(N - 1):
  u, v = map(int, input().split())
  e[u].append(v)
  e[v].append(u)

s = [1]
vis = [0] * (N + 1)
order = []
parent = [0] * (N + 1)
children = [0] * (N + 1)
while len(s):
  x = s.pop()
  vis[x] = 1
  order.append(x)
  for y in e[x]:
    if vis[y]: continue
    s.append(y)
    parent[y] = x
    children[x] += 1
cs = Counter()
cr = children[1]
for y in range(2, N + 1): cs[children[y]] += 1
#print(cs, cr)
res = [0] * (K + 1)
l = 0
csmx = max(cs.keys())

for c in range(K + 1):
  if c <= 1 and (cr > 0): continue
  if c <= 2 and (len(cs) > 0): continue
  if c - 1 >= cr and (c - 2 >= csmx):
    l = c
    break
#print(l)

class Factorial:
  def __init__(self, n, mod):
    self.f = [1]
    for i in range(1, n + 1):
      self.f.append(self.f[-1] * i % mod)
    self.i = [pow(self.f[-1], mod - 2, mod)]
    for i in range(1, n + 1)[: : -1]:
      self.i.append(self.i[-1] * i % mod)
    self.i.reverse()
  def factorial(self, i):
    return self.f[i]
  def ifactorial(self, i):
    return self.i[i]
  def combi(self, n, k):
    return self.f[n] * self.i[n - k] % mod * self.i[k] % mod

f = Factorial(K, mod)
smcs = sum(cs.values())
res[l] = f.factorial(l) * f.ifactorial(l - cr - 1) % mod
for k, v in cs.items():
  res[l] *= pow(f.factorial(l - 2) * f.ifactorial(l - k - 2) % mod, v, mod)
  res[l] %= mod
#print(res)
revs = [0] * (K + 1)
for i in range(K + 1): revs[i] = pow(i, mod - 2, mod)
for i in range(l, K):
  res[i + 1] = res[i] * pow(i - 1, smcs, mod) % mod
  res[i + 1] *= (i + 1) * revs[i - cr] % mod
  res[i + 1] %= mod
  for k, v in cs.items():
    res[i + 1] *= pow(revs[i - k - 1], v, mod)
    res[i + 1] %= mod

print(res[-1])

### FIXED CODE ###

from collections import defaultdict as ddydd
from collections import deque as dq
N, K = map(int, input().split())
mod = 10 ** 9 + 7
Tree = ddydd(list)
for _ in range(N - 1):
  a, b = map(int, input().split())
  Tree[a].append(b)
  Tree[b].append(a)
Q = dq(list())
visited = [0] * (N + 1)
visited[1] = 1
res = K
temp = K - 1
for n in Tree[1]:
  visited[n] = 1
  Q.append(n)
  res *= temp
  res = res % mod
  temp -= 1

while Q:
  n = Q.popleft()
  temp = K - 2
  for m in Tree[n]:
    if visited[m] == 0:
      visited[m] = 1
      Q.append(m)
      res *= temp
      res = res % mod
      temp -= 1
print(res)
RC = input().split()
r = int(RC[0])
c = int(RC[1])
A_c_sum = [0, 0, 0, 0, 0]
final_sum = 0
for i in range(r):
    A_r = input().split()
    A_r_sum = 0
    for j in range(c):
        A_c_sum[j] += int(A_r[j])
        print(A_r[j]+" ", end="")
        A_r_sum += int(A_r[j])
    print(A_r_sum)
    final_sum += A_r_sum
print(" ".join(map(str,A_c_sum))+" ",end="")
print(final_sum)

### FIXED CODE ###

RC = input().split()
r = int(RC[0])
c = int(RC[1])
A_c_sum =[]
final_sum = 0
for j in range(c):
    A_c_sum.append(0)
for i in range(r):
    A_r = input().split()
    A_r_sum = 0
    for j in range(c):
        A_c_sum[j] += int(A_r[j])
        print(A_r[j]+" ", end="")
        A_r_sum += int(A_r[j])
    print(A_r_sum)
    final_sum += A_r_sum
print(" ".join(map(str,A_c_sum))+" ",end="")
print(final_sum)
n = int(raw_input())

mat = []
for i in range(n):
    mat.append(map(int,raw_input().split()))
    
dp = [0,0,0]

for day in range(n):
    ndp = [0,0,0]
    data = mat[day]
    
    for i in range(n):
        for j in range(n):
            if i != j:
                ndp[j] = max(ndp[j], dp[i]+data[j])
    dp = ndp
print max(dp)
   

### FIXED CODE ###

n = int(raw_input())

dp = [0]*(3)

for i in range(n):
    dp_new = [0]*3
    c=map(int,raw_input().split())
    
    for i in range(3):
        for j in range(3):
            if i != j:
                dp_new[j] = max(dp_new[j],dp[i]+c[j])
    dp = dp_new
print(max(dp))
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

print(lcm(a, b))

### FIXED CODE ###

import math
import fractions
a, b = map(int, input().split())
print(math.floor((a*b) / fractions.gcd(a, b)))
def main():
  
    # n, m = map(int, input().split())
    # a = [int(input()) for i in range(m)]
	n, m = map(int, input().split())
    a = set(int(input()) for i in range(m))
    mod = 1000000007

    # フィボナッチ数列を作る要領で行う
    d = [0] * (n+1)
    # 2回0が続く状況aに連番があったら即座に終了する
    cnt = 0 
    # d[0]とd[1]を規定。aに1が含まれていることを考慮して場合分けしておく
    d[0] = 1
    if 1 not in a:
        d[1] = 1
    # else:
    #     d[1] = 1
    # 階段番号は2~nまでを見る必要がある
    for i in range(2, n+1):
        if i in a:
            d[i] = 0
            cnt += 1
            if cnt == 2:
                print('0')
                exit()
        else:
            d[i] = (d[i-1] + d[i-2]) % mod
            cnt = 0
    # print(d)  
    ans = d[n]        
    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

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

def main():
    # n, m = map(int, input().split())
    # a = [int(input()) for i in range(m)]
    n, m = map(int, readline().split())
    a = set(map(int, read().split()))
    mod = 1000000007

    # フィボナッチ数列を作る要領で行う
    d = [0] * (n+1)
    # 2回0が続く状況aに連番があったら即座に終了する
    cnt = 0 
    # d[0]とd[1]を規定。aに1が含まれていることを考慮して場合分けしておく
    d[0] = 1
    if 1 not in a:
        d[1] = 1
    # else:
    #     d[1] = 1
    # 階段番号は2~nまでを見る必要がある
    for i in range(2, n+1):
        if i in a:
            d[i] = 0
            cnt += 1
            if cnt == 2:
                print('0')
                exit()
        else:
            d[i] = (d[i-1] + d[i-2]) % mod
            cnt = 0
    # print(d)  
    ans = d[n]        
    print(ans)

if __name__ == '__main__':
    main()
import collections

N=int(input())
A=[int(_) for _ in input().split(" ")]
Q=int(input())

c = collections.Counter(A)


#d['k10'] = d.pop('k1')    
    
for i in range(Q):
  B,C=map(int,input().split(" "))
  
  if C in c:
    c[C] += c[B]
    del c[B]
  else:
    c[C] = c.pop(B)
  
  #print(c)
  
  s=list(c.keys())
  j=0
  ans=0
  for v in c.values():
    ans += s[j]*v
    j=j+1
  
  print(ans)


  
  

### FIXED CODE ###

import collections

N=int(input())
A=[int(_) for _ in input().split(" ")]
Q=int(input())

c = collections.Counter(A)

ans=0
for v in c:
  ans += v*c[v]

#print(c)
#d['k10'] = d.pop('k1')    
    
for i in range(Q):
  B,C=map(int,input().split(" "))
  
  if C in c:
    ans=ans-B*c[B]+C*c[B]
    c[C] += c[B]
    del c[B]
  else:
    ans=ans-B*c[B]+C*c[B]
    c[C] = c[B]
    del c[B]
  
  print(ans)
n,k=map(int,input().split())

a=list(map(int,input().split()))
a_reverse=list(reversed(a))
b=sorted(a)
s=sum(a)

ans=[]

for i in range(k+1):
  if i>n:
    I=i-n
    for j in range(I): 
      ans1=s-b[j]
    ans.append(ans1)
  elif i==n:
    ans.append(s)
  elif i==0:
    ans.append(0)
  else:
    for h in range(i+1):
      H=i-h
      c=[]
      for x in range(h):
        c.append(a[x])
      for y in range(H):
        c.append(a_reverse[y])
        
      c.sort()
      S=sum(c)
      for g in range(1,k-i+1):
        if g<=i:
          if c[g-1]<0:
            S-=c[g-1]

      ans.append(S)
      
print(max(ans))


### FIXED CODE ###

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

a=list(map(int,input().split()))
a_reverse=list(reversed(a))
b=sorted(a)
s=sum(a)

ans=[]

for i in range(k+1):
  if i>n:
    I=i-n
    for j in range(I): 
      if j<n:
        ans1=s-b[j]
    ans.append(ans1)
  elif i==n:
    ans.append(s)
  elif i==0:
    ans.append(0)
  else:
    for h in range(i+1):
      H=i-h
      c=[]
      for x in range(h):
        c.append(a[x])
      for y in range(H):
        c.append(a_reverse[y])
        
      c.sort()
      S=sum(c)
      for g in range(1,k-i+1):
        if g<=i:
          if c[g-1]<0:
            S-=c[g-1]

      ans.append(S)
      
print(max(ans))
h,n = map(int,input().split())
h = [0]*n
for i in range(n):
    h[i] = int(input())
h.sort()
ans = float('inf')
for i in range(n-k):
    ans = min(ans,abs(h[i+k-1]-h[i])
print(ans)


### FIXED CODE ###

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

h = [0]*n

for i in range(n):

    h[i] = int(input())

h.sort()

ans = float('inf')

for i in range(n-k+1):

    ans = min(ans,abs(h[i+k-1]-h[i]))

print(ans)