Harryxun/stf_run huggingface dataset:
n,m = map(int,input().split())
a_list = [int(input()) 
          for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a_list[i]] = 0
for j in range(2,n+1):
  if hoge[j] == 0:
    continue
  else:
    hoge[j] = hoge[j-1] + hoge[j-2]
  hoge[j] = hoge[j] % (10**9+7)
print(hoge[j])

### FIXED CODE ###

n,m = map(int,input().split())
a = [int(input()) for nesya in range(m)]
hoge = [1]*(n+1)
for i in range(m):
  hoge[a[i]] = 0
for j in range(1,n+1):
  if hoge[j] == 0:
    continue
  else:
    if j == 1:
      hoge[j] = hoge[j-1]
    else:
      hoge[j] = hoge[j-1] + hoge[j-2]
  hoge[j] = hoge[j] % (10**9+7)
print(hoge[j]%(10**9+7))
n=int(input())
l=list(map(int,input().split()))
ans=1
mod=10**9+7
me=[0,0,0]
now=3
for x in l:
  if x==0:
    ans*now
    now-=1
    me[-now]=1
  else:
    ans=ans*len([i for i, y in enumerate(me) if y == x])%mod
    me[me.index(x)]+=1
if now==0:
  print(6*ans%mod)
else:
  print(3*ans%mod)

### FIXED CODE ###

n=int(input())
mod=1000000007
l=list(map(int,input().split()))
me=[3]+[0]*2*n
ans=1
for x in l:
  ans=ans*me[x]%mod
  me[x]-=1
  me[x+1]+=1
print(ans)
# coding: utf-8

import math
import fractions
import heapq
import collections
import re
import array
import bisect

from collections import Counter, defaultdict


II = lambda: int(input())
MI = lambda: map(int, input().split())


def main():
    N, x = MI()
    if x in [1, 2 * N - 1]:
        print("No")
        return
    print("Yes")
    s = set([i for i in range(1, 2 * N)])
    a = [None] * (2 * N - 1)
    MED = N - 1
    if x == 2 * N - 2:
        l = (x - 1, x, x + 1, x - 2)
        a[MED - 1:MED + 3] = l
        for i in l:
            s.remove(i)
    else:
        l = x + 1, x, x - 1, x + 2
        a[MED - 1:MED + 3] = l
        for i in l:
            s.remove(i)
    for i in range(2 * N - 1):
        if a[i] is None:
            a[i] = s.pop()
    for i in range(2 * N - 1):
        print(a[i])


if __name__ == "__main__":
    main()


### FIXED CODE ###

# coding: utf-8

import math
import fractions
import heapq
import collections
import re
import array
import bisect

from collections import Counter, defaultdict


II = lambda: int(input())
MI = lambda: map(int, input().split())


def main():
    N, x = MI()
    if x in [1, 2 * N - 1]:
        print("No")
        return
    print("Yes")
    if N == 2:
        print("1\n2\n3")
        return
    s = set([i for i in range(1, 2 * N)])
    a = [None] * (2 * N - 1)
    MED = N - 1
    if x == 2 * N - 2:
        l = (x - 1, x, x + 1, x - 2)
        a[MED - 1:MED + 3] = l
        for i in l:
            s.remove(i)
    else:
        l = x + 1, x, x - 1, x + 2
        a[MED - 1:MED + 3] = l
        for i in l:
            s.remove(i)
    for i in range(2 * N - 1):
        if a[i] is None:
            a[i] = s.pop()
    for i in range(2 * N - 1):
        print(a[i])


if __name__ == "__main__":
    main()
import numpy as np
 
N = int(input())
l = map(int,input().split())
a = np.array(l)
count = 0
 
for i in range(len(a)):
    if a[i]%6 == 0 or a[i]%10 == 0:
        count += 1
    
if count:
    print("APPROVE")
else:
    print("DENIED")

### FIXED CODE ###

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

for i in range(len(a)):
    if a[i]%2 == 0:
        if a[i]%3 != 0 and a[i]%5 != 0:
            count += 1

if count:
    print("DENIED")
else:
    print("APPROVED")
D = int(input)
eve = "Eve" * (25 - D)
print("Christmas" + str(eve))

### FIXED CODE ###

D = int(input())
eve = "Eve " * (25 - D)
print("Christmas " + str(eve))
a,b,c = [int(i) for i in input().split()]
if a < b < c:
    print"Yes"
else:
    print"NO"

### FIXED CODE ###

nums = [int(i) for i in input().split()]
sort_nums = sorted(nums)
nums_str = map(str,sort_nums)
print(' '.join(nums_str))
r=int(input())
g=int(input())
print(g*2−r)

### FIXED CODE ###

r=int(input())
g=int(input())
print(2*g-r)
import numpy as np
import sys
from collections import deque
sys.setrecursionlimit(10**6)
input = sys.stdin.readline

def main():
  H, W = map(int, input().split())
  M = [['#' == x for x in input()] for _ in range(H)]
  que = deque([[i, j] for i in range(H) for j in range(W) if M[i][j]])
  ans = 0
  while que:
    qq = []
    ans += 1
    for nh, nw in que:
      if nw+1<=W-1 and not M[nh][nw+1]:
        qq.append([nh,nw+1])
        M[nh][nw+1] = True
      if  0<=nw-1 and not M[nh][nw-1]:
        qq.append([nh,nw-1])
        M[nh][nw-1] = True
      if nh+1<=H-1 and not M[nh+1][nw]:
        qq.append([nh+1,nw])
        M[nh+1][nw] = True
      if 0<=nh-1 and not M[nh-1][nw]:
        qq.appenad([nh-1,nw])
        M[nh-1][nw] = True
    que = qq
  print(ans-1)

if __name__ == "__main__":
  main()

### FIXED CODE ###

import copy
from collections import deque
def main():
  H, W = map(int, input().split())
  G = [['#' == x for x in input()] for _ in range(H)]
 
  black = deque([(i, j) for i in range(H) for j in range(W) if G[i][j]])
 
  ans = 0
  while True:
    ans += 1
    next_black = deque()
    while black:
      bi, bj = black.popleft()
      if bi > 0 and not G[bi - 1][bj]:
        G[bi - 1][bj] = True
        next_black.append((bi - 1, bj))
      if bj > 0 and not G[bi][bj - 1]:
        G[bi][bj - 1] = True
        next_black.append((bi, bj - 1))
      if bi < H - 1 and not G[bi + 1][bj]:
        G[bi + 1][bj] = True
        next_black.append((bi + 1, bj))
      if bj < W - 1 and not G[bi][bj + 1]:
        G[bi][bj + 1] = True
        next_black.append((bi, bj + 1))
    if next_black:
       black = copy.copy(next_black)
    else:
       break
  print(ans - 1)
  
if __name__ == "__main__":
  main()
h, w = map(int, input().split())
a = [list(map(int, input().split())) for i in range(h)]
b = [[[-1,-1]]*w for i in range(h)]
for i in range(h):
    for j in range(w):
        a[i][j] %= 2
count = 0 
for i in range(h-1):
    for j in range(w):
        if a[i][j] == 1:
            a[i][j] = 0
            a[i+1][j] = (a[i+1][j]+1)%2
            b[i][j] = [i+1, j]
            count += 1
for i in range(w):
    if a[h-1][i] == 1:
        a[h-1][i] = 0
        a[h-1][i+1] = (a[h-1][i+1]+1)%2
        b[h-1][i] = [h-1, i+1]
        count += 1
print(count)
for i in range(h):
    for j in range(w):
        if not b[i][j] == [-1,-1]:
            print(i+1, j+1, b[i][j][0]+1, b[i][j][1]+1)



### FIXED CODE ###

s = input()
h, w = map(int, s.split())
a = [list(map(int, input().split())) for i in range(h)]
b = [[[-1,-1]]*w for i in range(h)]
for i in range(h):
    for j in range(w):
        a[i][j] %= 2
count = 0
for i in range(h-1):
    for j in range(w):
        if a[i][j] == 1:
            a[i][j] = 0
            a[i+1][j] = (a[i+1][j]+1)%2
            b[i][j] = [i+1, j]
            count += 1
for i in range(w-1):
    if a[h-1][i] == 1:
        a[h-1][i] = 0
        a[h-1][i+1] = (a[h-1][i+1]+1)%2
        b[h-1][i] = [h-1, i+1]
        count += 1
print(count)
for i in range(h):
    for j in range(w):
        if not b[i][j] == [-1,-1]:
            print(i+1, j+1, b[i][j][0]+1, b[i][j][1]+1)
n, q = map(int, input().split())
s = input()
ac = [0]
for i in range(len(s)):
  if s[i] == 'A' and s[i+1] == 'C':
    ac.append(ac[i]+1)
  else:
    ac.append(ac[i])
for i in range(q):
  l, r = map(int, input().split())
  print(ac[r-1]-ac[l-1])
  


### FIXED CODE ###

n, q = map(int, input().split())
s = input()
ac = [0]
for i in range(len(s)-1):
  if s[i] == 'A' and s[i+1] == 'C':
    ac.append(ac[i]+1)
  else:
    ac.append(ac[i])
for i in range(q):
  l, r = map(int, input().split())
  print(ac[r-1]-ac[l-1])
from sys import maxsize as infinity
import resource
import sys

resource.setrlimit(resource.RLIMIT_STACK, (2**29, -1))
sys.setrecursionlimit(10**6)

dp = {}
minus_infinity = - (infinity // 2)


def exchange(amount: int) -> int:
    if amount < 0:
        return minus_infinity
    if amount == 0:
        return 0
    if amount in dp:
        return dp[amount]

    dp[amount] = max([
        1000 + exchange(amount - 500),
        5 + exchange(amount - 5),
        exchange(amount - 100),
        exchange(amount - 50),
        exchange(amount - 10),
        exchange(amount - 1)
    ])

    return dp[amount]


amount = int(input())
print(exchange(amount))


### FIXED CODE ###

from sys import maxsize as infinity


def exchange(amount: int) -> int:
    dp = [0] * (amount + 1)

    for to_exchange in range(amount + 1):
        dp[to_exchange] = 0

        for (coin, gain) in [(500, 1000), (5, 5), (100, 0), (50, 0), (10, 0), (1, 0)]:
            if coin <= to_exchange:
                dp[to_exchange] = max(
                    dp[to_exchange],
                    gain + dp[to_exchange - coin]
                )

    return dp[amount]


amount = int(input())
n_500, new_amount = divmod(amount, 500)
n_5, new_amount_2 = divmod(new_amount, 5)

print(n_500 * 1000 + n_5 * 5)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
                
    divisors.sort()
    return divisors


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

c_set = list(set(make_divisors(a))&set(make_divisors(b)))

c_set.sort()
print(c_set[-c])


### FIXED CODE ###

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

if b//a >= c:
    print(c)
else:
    print(b//a)
x,y = map(int,input().split())
print(y//2*n+1)

### FIXED CODE ###

x,y = map(int,input().split())
i=0
while x>0:
  i+=1
  x = x-(2*y+1)
print(i)
x = list(map(int, input().split()))  # n個の数字がリストに格納される

for i in 5:
  if x[i] is 0:
    print(i+1)

### FIXED CODE ###

x = list(map(int, input().split()))  # n個の数字がリストに格納される

for i in range(5):
  if x[i] is 0:
    print(i+1)
ABC=input().split()

A=int(ABC[0])
B=int(ABC[1])
C=int(ABC[2])
AB=math.sqrt(AB)
if A+B+AB<C :
    print ("Yes")
else :
    print ("No")

### FIXED CODE ###

import math
ABC=input().split()
 
a=int(ABC[0])
b=int(ABC[1])
c=int(ABC[2])
 
if a*a+b*b+c*c-2*a*b-2*a*c-2*b*c>0 and a+b<c  :
    print ("Yes")
else :
    print ("No")
a,b,c=map(int,input().split())
print(sum([a,b,c]-max(a,b,c)))

### FIXED CODE ###

a,b,c=map(int,input().split())
print(sum([a,b,c])-max(a,b,c))
a, b = map(int(input()))
if a%2 == 1:
  if b%2 == 1:
  	print("Yes")
    else:
      print("No")
  else:
    print("No")


### FIXED CODE ###

a, b = map(int,(input().split(" ")))
if ((a%2) * (b%2)) != 0:
  print("Yes")
else:
  print("No")
a=map(int, raw_input().split())
a=sorted(a)
for i in range(2):
    print L[i] + " "

### FIXED CODE ###

a = map(int, raw_input().split())
a.sort()
for i in range(len(a)):
    print a[i],
n=int(input())
a=[int(x) for x in input().split()]
c=0
for i in range(n):
  c+=1//i
print(1//c)

### FIXED CODE ###

n=int(input())
a=[int(x) for x in input().split()]
c=0
for i in range(n):
  c+=a[i]**(-1)
print(c**(-1))
a, b, q = list(map(int, input().split()))
ss, tt, xx = [], [], []
for _ in range(a):
    ss.append(int(input()))
for _ in range(b):
    tt.append(int(input()))
for _ in range(q):
    xx.append(int(input()))

ss.sort()
tt.sort()

import bisect
def get_left(aa, bb, pos):
    a1 = bisect.bisect_left(aa, pos)
    b1 = bisect.bisect_left(bb, pos)
    if a1 == b1 == 0:
        return 10 ** 9
    if a1 == 0 or (b1 > 0 and bb[b1 - 1] > aa[a1 - 1]):
        dists = [10 ** 9]
        if a1 < len(aa):
            dists.append(pos - bb[b1 - 1] + aa[a1] - bb[b1 - 1])
        if a1 > 0:
            dists.append(pos - aa[a1 - 1])
        return min(dists)
    dists = [10 ** 9]
    if b1 < len(bb):
        dists.append(pos - aa[a1 - 1] + bb[b1] - aa[a1 - 1])
    if b1 > 0:
        dists.append(pos - bb[b1 - 1])
    return min(dists)

def get_right(aa, bb, pos):
    a1 = bisect.bisect_left(aa, pos)
    b1 = bisect.bisect_left(bb, pos)
    if a1 == len(aa) and b1 == len(bb):
        return 10 ** 9
    if a1 == len(aa) or (b1 < len(bb) and bb[b1] < aa[a1]):
        dists = [10 ** 9]
        if a1 > 0:
            dists.append(- pos + bb[b1] - aa[a1 - 1] + bb[b1])
        if a1 < len(aa):
            dists.append(aa[a1] - pos)
        return min(dists)
    dists = [10 ** 9]
    if b1 > 0:
        dists.append(- pos + aa[a1] - bb[b1 - 1] + aa[a1])
    if b1 > 0:
        dists.append(bb[b1] - pos)
    return min(dists)

for x in xx:
    print(min(get_left(ss, tt, x), get_right(ss, tt, x)))


### FIXED CODE ###

import bisect
A, B, Q = list(map(int, input().split()))
S, T, X = [], [], []
for _ in range(A):
    S.append(int(input()))
for _ in range(B):
    T.append(int(input()))
for _ in range(Q):
    X.append(int(input()))
INF = 10 ** 12
S = [-INF] + S + [INF]
T = [-INF] + T + [INF]

for x in X:
    ans = INF
    sr = bisect.bisect_right(S, x)
    tr = bisect.bisect_right(T, x)
    for s in S[sr-1: sr+1]:
        for t in T[tr-1: tr+1]:
            ans = min(ans, abs(s-x) + abs(s-t), abs(t-x) + abs(s-t))
    print(ans)
import bisect
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort()
B.sort()
C.sort()
sum = 0
for i in range(0,N):
  a = A[i]
  for j in range(1,N):
    b = B[j]
    c_min = b-a+1
    c_max = a+b-1
    l = bisect.bisect_left(C,c_min,lo = j+1)
    if l! = N:
      r = bisect.bisect_right(C,c_max,lo = j+1)
      if r:
        r = r-1
        if r >= l:
          sum += r-l+1
print(sum)

### FIXED CODE ###

import bisect
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
A.sort()
C.sort()
for i in B:
    x = bisect.bisect_left(A,i)
    y = N-bisect.bisect_right(C,i)
    ans += x*y
print(ans)
w = input().lower()
t = 0
while True:
    s = input().lower()
    if s == "END_OF_TEXT":
        break
    t += s.count(w)
print(t)

### FIXED CODE ###

w = input().lower()
t = 0
while True:
    s = input()
    if s == "END_OF_TEXT":
        break
    t += s.lower().split().count(w)
print(t)
s, t = input().split()
    
    print(t + s)

### FIXED CODE ###

s, t = input().split()
    
print(t + s)
n = int(input())
S = input()
l = int(input())
A = str(S[l-1])
for i in range(n):
  if S[i] != A:
    S[i] = '*'
print(S)


### FIXED CODE ###

n = int(input())
s = input()
k = int(input())
for i in range(n):
  if s[i] != s[k-1]:
    s = s.replace(s[i], '*')
print(s)
d1,d2 = [],[]
n = int(input())
for i in range(n):
    a,b=map(int,input().split())
    d1.append(a)
    d2.append(b)
for i in n-2:
  if d1[i] == d2[i] and d1[i+1] == d2[i+1] and d1[i+2] == d2[i+2]:
	print("Yes")
  return 0

print("No")


### FIXED CODE ###

ans = "No"
count = 0
n = int(input())
for i in range(n):
  a,b=map(int,input().split())
  if a == b:
    count += 1
    if count >= 3:
        ans ="Yes"
  else:
    count = 0

print(ans)
L = list(map(int, input().split().split()))

if L[0]==L[1]==L[2]:
    print("no")
else:
    print("yes")

### FIXED CODE ###

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

if a==b and a!=c:
    print("Yes")
elif a==c and a!=b:
    print("Yes")
elif b==c and b!=a:
    print("Yes")
else:
    print("No")
x = input()
y = input()

x = int(x)
y = int(y)
 
if(x + y >= 10):
  print("error")
else:
  print(x+y)

### FIXED CODE ###

x, y = input().split()

x = int(x)
y = int(y)

if x + y >= 10 :
  print("error")
else:
  print(x+y)
n = raw_input()

a = int(n.split())

b = a[0] * a[1]

c = (a[0] + a[1]) * 2

print b , c

### FIXED CODE ###

n = raw_input()

a = n.split(" ")

b = int(a[0])

c = int(a[1])

print b * c , (b + c) * 2
from collections import deque
def bfs():
    Q = deque()
    Q.append(0)
    #今の時刻
    i = 1
    while len(Q) > 0:
        x = Q.popleft()
        if x-i >= 0:
            T[i][x-i] = 1
            if x-i == X: return i
            Q.append(x-i)
        if 0 <= x and x <= X:
            T[i][x] = 1
            if x == X: return i
            Q.append(x)
        if x+i <= X:
            T[i][x+i] = 1
            if x+i == X: return i
            Q.append(x+i)
        i += 1

X = int(input())
INF = 10**9 +1
#時刻iで座標jに到着できるかどうか
T = [[0 for _ in range(X+1)] for _ in range(X**2)]
T[0][0] = 1
print(bfs())


### FIXED CODE ###

W, a, b = map(int,input().split())
print(max(b-(a+W),(a-(b+W)),0))
def ABC158D():
    s = input()
    q = int(input())
    for i in range(2, q):
        txt3 = input().split()
        print(f"txt3 = {txt3}")
        if txt3[0] == '1':
            s = s[::-1]
        else:
            if txt3[1] == '1':
                s = txt3[2] + s
            else:
                s = s + txt3[2]
    print(s)

ABC158D()


### FIXED CODE ###


s = input()
q = int(input())
ht = 1
head = ''
tail = ''
count = 0
for i in range(q):
    txt3 = input().split()
    if txt3[0] == '1':
        ht = 3 - ht
        count += 1
    else:
        if int(txt3[1]) == ht:
            head = txt3[2] + head
        else:
            tail = tail + txt3[2]
s = head + s + tail
if count % 2 == 1:
    s = s[::-1]
print(s)
S = list(map(int, input()))
K = int(input())
if S[0] == 1:
    print(S[1])
else:
    print(S[0])

### FIXED CODE ###

import math
S = list(map(int, input()))
K = int(input())
count = 0
after_S = 0
days = 5000000000000000-1
for n in S:
    if n == 1:
        count += 1
    else:
        break
if count > 0 and math.log(count) >= math.log(K):
    print(1)
else:
    for n in S:
        after_S += days * math.log(n)
        if after_S >= math.log(K):
            print(n)
            break
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter

def main():
    N,M = map(int, input().split())

    L = [[0]*N for _ in range(N)] # n*nの隣接行列の作成
    for _ in range(M): # 隣接行列の作成
        a,b = map(int, input().split())
        L[a-1][b-1] = 1
        L[b-1][a-1] = 1

    d = [0]*N # 訪問スタンプ
    p = [0]*N # パス

    def dfs(x):
        d[x] = 1
        print("a",p)
        for v in range(N):
            if L[x][v] == 0:
                continue
            if p[v] == 0 and d[v] == 0:
                p[v] = x+1
                print(p)
            elif p[v] != x and d[v]==0:
                print("No")
                exit()
            if d[v] == 0:
                dfs(v)

    for u in range(N):
        if d[u] == 0:
            dfs(u)
    print(p)


if __name__=="__main__":
    main()


### FIXED CODE ###

from collections import deque
n,m = map(int,input().split())
g = [[] for _ in range(n)]
for _ in range(m):
    a,b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)

q = deque([0])
d = [-1]*n
d[0] = 0
ans = [0]*n
print("Yes")

while q:
    p = q.popleft() # 先に入れた要素を取り出す
    for node in g[p]:
        if d[node] == -1:
            d[node] = d[p] + 1
            q.append(node) # リストへの追加
        else:
            if d[node] + 1 == d[p]:
                ans[p] = node + 1

for i in range(1,n):
    print(ans[i])
from collections import defaultdict
n=int(input())
d=list(map(int,input().split()))
mod=998244353
if d[0]!=0:
      print(0)
      exit()
dd=defaultdict(lambda:0)
for di in d:
      dd[di]+=1
if dd[0]>1:
      print(0)
      exit()
ans=1
for i in dd.keys():
      if i==0:
            continue
      ans*=(dd[i-1]**dd[i])%mod
print(ans%mod)      

### FIXED CODE ###

from collections import defaultdict
n=int(input())
d=list(map(int,input().split()))
mod=998244353
if d[0]!=0:
      print(0)
      exit()
dd=defaultdict(lambda:0)
for di in d:
      dd[di]+=1
if dd[0]>1:
      print(0)
      exit()
ans=1
for i in set(dd.keys()):
      if i==0:
            continue
      ans*=(dd[i-1]**dd[i])%mod
print(ans%mod)
a = int(input())
print "Yes" if a % 9 == 0 else "No"

### FIXED CODE ###

a=int(input())
print("Yes"if a%9==0else"No")
def bfs(graph, start, goal, connection):
    visited = {start: None}
    unvisited = [start]
    while unvisited:
        now = unvisited[0]
        if now == goal or connection[1000000*now + goal] == 1:
            connection[1000000*start + goal] = 1
            return "yes"
        unvisited = unvisited[1:]
        for next in graph[now][1:]:
            if not (next in visited):
                unvisited.append(next)
                visited[next] = now
    return "no"

n, m = map(int, input().split())
g = [[i] for i in range(n)]
c = {}

for i in range(m):
    inp = list(map(int, input().split()))
    g[inp[0]].append(inp[1])
    g[inp[1]].append(inp[0])

q = int(input())

for i in range(q):
    s, t = map(int, input().split())
    print(bfs(g, s, t, c))

### FIXED CODE ###

from collections import deque

def bfs(graph, start):
    visited = {start: None}
    unvisited = deque()
    unvisited.append(start)
    while unvisited:
        now = unvisited.popleft()
        for next in graph[now]:
            if not (next in visited):
                unvisited.append(next)
                visited[next] = now
    return visited

n, m = map(int, input().split())
g = [set() for i in range(n)]
group = []

for i in range(m):
    a, b = map(int, input().split())
    g[a].add(b)
    g[b].add(a)

q = int(input())

for i in range(q):
    s, t = map(int, input().split())
    for j in range(len(group)):
        if s in group[j] and t in group[j]:
            print("yes")
            break
        elif s in group[j]:
            print("no")
            break
    else:
        group_tmp = set(bfs(g, s).keys())
        if t in group_tmp:
            print("yes")
        else:
            print("no")
        group.append(group_tmp)
MAX_N = 10**5
DP = [None] * (MAX_N + 1)  # 計算結果を保存する配列
DP[0] = 0  # 定義より
DP[1] = 1  # 定義より

def fib(n):
    # フィボナッチ数を2からnまで順に求めていく
    for i in range(2, n + 1):
        DP[i] = DP[i-1] + DP[i-2]
    return DP[n]

MOD = 10**9 + 7

N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]

ans = fib(a[0])
for i in range(M-1):
    ans *= fib(a[i+1] - a[i] - 1)
    ans %= MOD
ans *= fib(N - a[M-1])
ans %= MOD

print(ans)


### FIXED CODE ###

from itertools import product

INF = 1000000007

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 _ in range(M)]
ans, start = 1, 0
tmp = []

for i in range(len(a)):
	if a[i] - a[i - 1] == 1:
		print(0)
		exit()

for k in a:
	tmp.append(fib(k - start) % INF)
	start = k + 1

for j in tmp:
	ans *= j
	ans %= INF

ans *= fib(N - start + 1)
print(ans % INF)
N = int(input())
A = map(int, raw_input().split())

def dp(A):
    if len(A) == 2:
        return A[0] + A[1] if A[0] + A[1] > -A[0] + -A[1] else -A[0] + -A[1]

    A_last, rA_last = A[-1], -A[-1]
    rA = A[:-1]
    rA[-1] = -rA[-1]
    return max( dp(A[:-1])+A_last, dp(rA)+rA_last)

print '{}'.format(dp(A))


### FIXED CODE ###

# D - Flipping Signs
# https://atcoder.jp/contests/abc125/tasks/abc125_d

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

ng_cnt = 0

for i in range(N):
    if A[i] < 0:
        ng_cnt += 1
        A[i] = -A[i]

if ng_cnt % 2 == 0:
    print '{}'.format( sum(A) )
else:
    print '{}'.format( sum(A) - min(A)*2)
input_A=input()
input_B=input()

A=int(input_A)
B=int(input_B)

answer1=A+B
answer2=A-B
answer3=A*B

print(max(answer1,answer2,answer3))

### FIXED CODE ###

A,B=map(int,input().split())
print(max(A+B,A-B,A*B))
print (int(raw_input()) + int(raw_input())) % 24


### FIXED CODE ###

print sum(map(int, raw_input().split())) % 24
import random
import math
n = int(input())
a = list(map(int, input().split()))

res = []
ans = []
x = 0
while x < math.factorial(n)/2:
  c = random.sample(a, 2)
  if c not in res:
    res.append(c)
    x += 1 
    ans.append(math.gcd(c[0],c[1]))
print(max(ans))

### FIXED CODE ###

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

import math
l_gcd = []
r_gcd = []

c = a[0]
for i in a[:-1]:
  c = math.gcd(c, i)
  l_gcd.append(c)
  
c = a[-1]
for j in a[1:][::-1]:
  c = math.gcd(c, j)
  r_gcd.append(c)
  
ans = max(r_gcd[-1], l_gcd[-1])
for r, l in zip(r_gcd[:-1], l_gcd[:-1][::-1]):
  c = math.gcd(r, l)
  ans = max(ans, c)
print(ans)