CodeEff/ECCO huggingface dataset:
# Original solution
n,m = list(map(int,input().split()))
a = [0] * m
for i in range(m):
    a[i] = int(eval(input()))
 
MOD = 10 ** 9 + 7
dp = [0] * (n + 1)
dp[0] = 1
 
for i in range(1, n + 1):
    if i in a:
        continue
    x = dp[i - 1]
    if i > 1:
        x += dp[i - 2]
    dp[i] = x % MOD
ans = dp[n]
print(ans)

# Optimized solution
N, M = [int(x) for x in input().split()]
a = set(int(eval(input())) for _ in range(M))
 
MOD = 10 ** 9 + 7
dp = [0] * (N + 1)
dp[0] = 1
 
for i in range(1, N + 1):
  if i in a:
    continue
  x = dp[i - 1]
  if i > 1:
    x += dp[i - 2]
  dp[i] = x % MOD
 
ans = dp[N]
print(ans)
# Original solution
# 2019-11-14 10:01:24(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

mod = 10 ** 9 + 7
def main():
    n, m, *broken_treads = [int(x) for x in sys.stdin.read().split()]
    safe = sorted((set(range(1, n+1)) - set(broken_treads)))

    p = [0, 1] # p[i] は連続するi段の、1~i段目までの登り方の総パターン
    for _ in range(n):
        p.append(p[-1] + p[-2])

    count = 1 # 最初に0th stepを踏んでいるので1
    sections = []
    for i in range(1, n+1):
        if i in safe:
            count += 1
        else:
            if count >= 1:
                sections.append(p[count])
                count = 0
            else: # countが0だったら一つ前も壊れている
                print((0))
                sys.exit()
    
    if count >= 1:    # if the last is not broken.
        sections.append(p[count])

    ans = reduce(lambda x, y: x * y % mod, sections)
    print(ans)

if __name__ == "__main__":
    main()


# Optimized solution
import sys

mod = 10 ** 9 + 7
n, m, *a = [int(x) for x in sys.stdin.read().split()]

dp = [0] * (n + 2)
dp[0] = 0
dp[1] = 1
for i in range(2, n+2):
    if i - 1 in a:
        if dp[i-1] == 0:
            print((0))
            sys.exit()
        else:
            dp[i] = 0
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod

print((dp[-1]))
# Original solution
import sys

mod = 10 ** 9 + 7
n, m, *a = [int(x) for x in sys.stdin.read().split()]

dp = [0] * (n + 2)
dp[0] = 0
dp[1] = 1
for i in range(2, n+2):
    if i - 1 in a:
        if dp[i-1] == 0:
            print((0))
            sys.exit()
        else:
            dp[i] = 0
    else:
        dp[i] = (dp[i-1] + dp[i-2]) % mod

print((dp[-1]))

# Optimized solution
import sys

mod = 10 ** 9 + 7
n, m, *a = [int(x) for x in sys.stdin.read().split()]

safe = sorted(set(range(1,n+1)) - set(a))
dp = [0] * (n + 2)
dp[0] = 0
dp[1] = 1
for i in safe:
    dp[i+1] = (dp[i] + dp[i-1]) % mod

print((dp[-1]))
# Original solution
import sys

mod = 10 ** 9 + 7
n, m, *a = [int(x) for x in sys.stdin.read().split()]

safe = sorted(set(range(1,n+1)) - set(a))
dp = [0] * (n + 2)
dp[0] = 0
dp[1] = 1
for i in safe:
    dp[i+1] = (dp[i] + dp[i-1]) % mod

print((dp[-1]))

# Optimized solution

# 2019-11-14 10:01:24(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

mod = 10 ** 9 + 7
def main():
    n, m, *a = [int(x) for x in sys.stdin.read().split()]

    safe = sorted(set(range(1,n+1)) - set(a))
    dp = [0] * (n + 2) # dp[i+1]: i段目までいくパターン数
    dp[0] = 0  # -1段目にはいけない
    dp[1] = 1  # 初期条件(0段目にいる)
    for i in safe:
        dp[i+1] = (dp[i] + dp[i-1]) % mod

    print((dp[-1]))

if __name__ == "__main__":
    main()
# Original solution
n,m=list(map(int,input().split()))
ls=[int(eval(input())) for i in range(m)]

def dp(n,ls):
    dp_table=[[0 for i in range(n+1)]]
    dp_table[0][0]=1
    sum=0
    count=1
    edge=0
    while True:
        row=[0]*count
        previous=dp_table[-1]
        for i in range(count,n+1):
            if i in ls:
                row.append(0)
            elif i==0:
                row.append(0)
            elif i==1:
                row.append(previous[0])
            else:
                row.append(previous[i-1]+previous[i-2])
            if i==edge+2:
                edge=i
                row=row+([0]*(n-edge))
                break
        sum+=row[-1]
        if row.count(0)==n+1:
            return sum
        dp_table.append(row)
        count+=1

print((dp(n,ls)%1000000007))

# Optimized solution
n,m=list(map(int,input().split()))
ls=[int(eval(input())) for i in range(m)]

if 1 in ls:
    steps=[1,0]
else:
    steps=[1,1]

while len(steps)<=n:
    this_step=len(steps)
    if this_step in ls:
        ap=0
    else:
        ap=steps[-1]+steps[-2]
    steps.append(ap)

print((steps[-1]%1000000007))
# Original solution
n,m=list(map(int,input().split()))
danger=[int(eval(input())) for i in range(m)]

if 1 in danger:
    steps=[1,0]
else:
    steps=[1,1]

for this_step in range(2,n+1):
    if this_step in danger:
        ap=0
    else:
        ap=steps[-1]+steps[-2]
    steps.append(ap)

print((steps[-1]%1000000007))

# Optimized solution
n,m = list(map(int,input().split()))
a = [int(eval(input())) for _ in range(m)]
a = set(a)
mod = 10**9+7
dp = [0]*(n+1)
dp[0] = 1
if 1 not in a:
    dp[1] = 1
for i in range(2,n+1):
    if i not in a:
        dp[i] = dp[i-1]+dp[i-2]
print((dp[-1]%mod))
# Original solution
n,m=list(map(int,input().split()))
danger=[int(eval(input())) for i in range(m)]
steps=[0]*(n+1)
steps[0]=1

if 1 in danger:
    steps[1]=0
else:
    steps[1]=1

for this_step in range(2,n+1):
    if this_step in danger:
        ap=0
    else:
        steps[this_step]=steps[this_step-1]+steps[this_step-2]

print((steps[-1]%1000000007))

# Optimized solution
n,m=list(map(int,input().split()))
danger=[int(eval(input())) for i in range(m)]
danger=set(danger)
steps=[0]*(n+1)
steps[0]=1

if 1 in danger:
    steps[1]=0
else:
    steps[1]=1

for this_step in range(2,n+1):
    if this_step in danger:
        ap=0
    else:
        steps[this_step]=steps[this_step-1]+steps[this_step-2]

print((steps[-1]%1000000007))
# Original solution
def main():
    N, M = list(map(int, input().split()))
    broken = [int(eval(input())) for _ in range(M)]
    div = 1000000007

    comb_list = [0] * (N + 1)
    comb_list[0] = 1
    if 1 not in broken:
        comb_list[1] = 1

    for i in range(2, N + 1):
        if i in broken:
            continue
        comb_list[i] = (comb_list[i - 1] + comb_list[i - 2]) % div

    print((comb_list[-1]))


if __name__ == "__main__":
    main()

# Optimized solution
def main():
    N, M, *a = list(map(int, open(0).read().split()))
    div = 1000000007
    broken = set(a)

    comb_list = [0] * (N + 1)
    comb_list[0] = 1
    if 1 not in broken:
        comb_list[1] = 1

    for i in range(2, N + 1):
        if i in broken:
            continue
        comb_list[i] = (comb_list[i - 1] + comb_list[i - 2]) % div

    print((comb_list[-1]))


if __name__ == "__main__":
    main()
# Original solution
import sys
sys.setrecursionlimit(int(1e6))

n,m=list(map(int,input().split()))
memo=[0]*(n+1)
memo[0]=1
memo[1]=1
for i in range(m):
    memo[int(eval(input()))]=-2
def dp(i):
    if memo[i]==-2:
        return 0
    elif memo[i]==0:
        s=dp(i-1)
        if i>=2:
            s+=dp(i-2)
        memo[i]=s%(10**9+7)
        return memo[i]
    else:
        return memo[i]
        
print((dp(n)))

# Optimized solution
import sys
sys.setrecursionlimit(int(1e6))

n,m=list(map(int,input().split()))
memo=[-1]*(n+1)
memo[0]=1
memo[1]=1
for i in range(m):
    memo[int(eval(input()))]=-2
def dp(i): #i段目(0~n)まで行く方法
    if memo[i]==-2:
        return 0
    elif memo[i]==-1:
        s=dp(i-1)
        if i>=2:
            s+=dp(i-2)
        memo[i]=s%(10**9+7)
        return memo[i]
    else:
        return memo[i]
print((dp(n)))
# Original solution
N,M=list(map(int,input().split()))
A=[]
B=[]
a=[]
a.append(0)
x=0
d=1
A.append(1)
A.append(2)
B.append(1)
B.append(1)
for j in range(2,N):
    A.append(A[j-1]+A[j-2])
    B.append(B[j-1]+B[j-2])
for i in range(1,M+1):
    a.append(int(eval(input())))
    if a[i-1]==0:
        if a[i]==1:
            d=1
        else:
            x=A[a[i]-a[i-1]-2]
            d=d*x%(10**9+7)
    else:
        x=B[a[i]-a[i-1]-2]
        d=d*x%(10**9+7)
    if i>1:
        if a[i]-a[i-1]==1:
            d=0
c=N-a[M]
if c==1:
    print(d)
elif c==N:
    x=A[c-1]
    d=d*x%(10**9+7)
    print(d)
else:
    x=A[N-a[M]-2]
    d=d*x%(10**9+7)
    print(d)

# Optimized solution
N,M=list(map(int,input().split()))
dp=[1]*(N+1)
for _ in range(M):
    a=int(eval(input()))
    dp[a]=0
for i in range(2,N+1):
    if dp[i]!=0:
        dp[i]=dp[i-1]+dp[i-2]
print((dp[N]%(10**9+7)))
# Original solution
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]

arr = [0] * (n+1)
arr[0] = 1
for i in range(1, n+1):
    if i in a:
        arr[i] = 0
    else:
        arr[i] = (arr[i-1] + arr[i-2]) % 1000000007

print((arr[-1]))


# Optimized solution
n, m = list(map(int, input().split()))
a = set(int(eval(input())) for _ in range(m))

arr = [0] * (n+1)
arr[0] = 1
for i in range(1, n+1):
    if i in a:
        arr[i] = 0
    else:
        arr[i] = (arr[i-1] + arr[i-2]) % 1000000007

print((arr[-1]))
# Original solution
#-*- coding:utf-8 -*-

N, M = list(map(int, input().split()))
hsh = {}
for i in range(M):
    hsh[int(eval(input()))] = True

acc = [0 for _ in range(N+1)]
acc[0] = 1

for i in range(1,N+1):
    if i > 1 and i-2 in hsh:  # 2段前が穴
        if i-1 in hsh: # 1段前が穴
            d = 0
        else:
            d = acc[i-1]
    else:  # 2段前が穴ではない
        s = acc[i-2] if i > 1 else 0
        if i-1 in hsh:  # 1段前が穴
            d = s
        else: 
            d = acc[i-1] + s
    acc[i] = d

# print(hsh)
# print(acc)
print((acc[-1]%1000000007))


# Optimized solution
#-*- coding:utf-8 -*-

N, M = list(map(int, input().split()))
hsh = {}
for i in range(M):
    hsh[int(eval(input()))] = True

acc = [0 for _ in range(N+1)]
acc[0] = 1
if 1 in hsh:
    acc[1] = 0
else:
    acc[1] = 1

for i in range(2,N+1):
    if i-2 in hsh:  # 2段前が穴
        if i-1 in hsh: # 1段前が穴
            d = 0
        else:
            d = acc[i-1]
    else:  # 2段前が穴ではない
        if i-1 in hsh:  # 1段前が穴
            d = acc[i-2]
        else: 
            d = acc[i-1] + acc[i-2]
    acc[i] = d

# print(hsh)
# print(acc)
print((acc[-1]%1000000007))
# Original solution
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
b = list(range(1, n+1))
for i in a:
  b.remove(i)

dp = [0] * (n+1)
dp[0] = 1

if b[0] == 1:
  dp[1] = 1
  b.pop(0)
else:
  dp[1] = 0

  
for i in b:
  dp[i] = (dp[i-1]%1000000007 + dp[i-2]%1000000007)%1000000007
  
print((dp[n]%1000000007))


# Optimized solution
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
a.append(0)

dp = [0] * (n+1)
dp[0] = 1
acounter = 0
if a[0] == 1:
  dp[1] = 0
  acounter = 1
else:
  dp[1] = 1

for i in range(2, n+1):
  if i == a[acounter]:
    dp[i]=0
    acounter+=1
  else:
    dp[i] = (dp[i-1]%1000000007 + dp[i-2]%1000000007)%1000000007
  
print((dp[n]%1000000007))
# Original solution
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n, m = list(map(int, input().split()))
a = []
for _ in range(m):
    a.append(int(eval(input())))

memo = [0]*(n+1)
memo[0]=1
if not(1 in a):
    memo[1]=1

for i in range(2,n+1):
    #print(i)
    if i in a:
        continue
    #print(memo[i-1],memo[i-2])
    memo[i]=memo[i-2]+memo[i-1]
            

#print(memo)
print((memo[n]% 1000000007))

# Optimized solution
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n, m = list(map(int, input().split()))
a = []
for _ in range(m):
    a.append(int(eval(input())))
a=set(a)

memo = [0]*(n+1)
memo[0]=1
if not(1 in a):
    memo[1]=1

for i in range(2,n+1):
    #print(i)
    if i in a:
        continue
    #print(memo[i-1],memo[i-2])
    memo[i]=memo[i-2]+memo[i-1]
            

#print(memo)
print((memo[n]% 1000000007))
# Original solution
mod = 10 ** 9 + 7

n, m = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(m)]
dp = [0] * (n + 1)
dp[0] = 1
for i in range(1, n + 1):
    if i not in A:
        if i == 1:
            dp[i] = dp[i - 1] % mod
        else:
            dp[i] = dp[i - 1] + dp[i - 2] % mod
print((dp[n] % mod))

# Optimized solution
mod = 10 ** 9 + 7

n, m = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(m)]
not_wet = [True] * (n + 1)
for a in A:
    not_wet[a] = False
dp = [0] * (n + 1)
dp[0] = 1
for i in range(1, n + 1):
    if not_wet[i]:
        if i == 1:
            dp[i] = dp[i - 1] % mod
        else:
            dp[i] = dp[i - 1] + dp[i - 2] % mod
print((dp[n] % mod))
# Original solution
from functools import lru_cache

import sys
sys.setrecursionlimit(1000000)

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

A = [int(eval(input())) for _ in range(M)]

@lru_cache(1000000)
def dfs(pos):
    if pos > N:
        return 0
    if pos == N:
        return 1
    if pos in A:
        return 0
    return dfs(pos + 2) + dfs(pos + 1)

print((dfs(0) % 1000000007))


# Optimized solution
from functools import lru_cache

import sys
sys.setrecursionlimit(1000000)

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

A = [int(eval(input())) for _ in range(M)]

@lru_cache(None)
def dfs(pos):
    if pos > N:
        return 0
    if pos == N:
        return 1
    if pos in A:
        return 0
    return dfs(pos + 2) + dfs(pos + 1)

for i in reversed(list(range(N))):
    dfs(i)

print((dfs(0) % 1000000007))
# Original solution
# python 3.4.3
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N,M = list(map(int,input().split()))
A = list(int(eval(input())) for _ in range(M))

mod = 10**9+7

# dp[i] : i番目の階段までの場合の数
dp = [0]*(N+1) 
dp[0] = 1
dp[1] = 1 if 1 not in A else 0 

for i in range(2,N+1):
    if i not in A:
        dp[i] = dp[i-1] + dp[i-2]
        dp[i] %= mod

print((dp[N]))


# Optimized solution
# python 3.4.3
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N,M = list(map(int,input().split()))
A = list(int(eval(input())) for _ in range(M))

mod = 10**9+7

# 床が壊れてる階段を高速に判別できるように
B = [True]*(N+1)
for a in A:
    B[a] = False

# dp[i] : i番目の階段までの場合の数
dp = [0]*(N+1) 
dp[0] = 1
dp[1] = 1 if 1 not in A else 0 

for i in range(2,N+1):
    if B[i]:
        dp[i] = dp[i-1] + dp[i-2]
        dp[i] %= mod

print((dp[N]))
# Original solution
import sys
input = sys.stdin.readline
mod = 1000000007
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
ans = 0
dp = [0] * (n+1)
dp[0] = 1
for i in range(n):
    dp[i] %= mod
    if i in a:
        continue
    if i + 1 <= n:
        dp[i+1] += dp[i]
    if i + 2 <= n:
        dp[i+2] += dp[i]
print((dp[n] % mod))

# Optimized solution
MOD = 10 ** 9 + 7
n, m = list(map(int, input().split()))
broken = [False] * (n + 1)
for i in range(m):
    a = int(eval(input()))
    broken[a] = True
dp = [0] * (n+1)
dp[0] = 1
for i in range(n):
    dp[i] %= MOD
    if broken[i]:
        dp[i] = 0
    if i + 1 <= n:
        dp[i+1] += dp[i]
    if i + 2 <= n:
        dp[i+2] += dp[i]
print((dp[n] % MOD))
# Original solution
N,M = list(map(int,input().split()))
MOD = 10**9+7
dp = [0]*(N+1)
dp[0]=1
A = [int(eval(input())) for i in range(M)]
ban = [1]*(N+1)
for a in A:
    ban[a]=0
for i in range(N):
    if i-1>=0:
        dp[i+1]=dp[i]*ban[i]+dp[i-1]*ban[i-1]
    else:
        dp[i+1]=dp[i]*ban[i]
    dp[i+1] %= MOD 
print((dp[N]))

# Optimized solution
N,M = list(map(int,input().split()))
A = [int(eval(input())) for i in range(M)]
MOD = 10**9+7
A = set(A)
dp = [0]*(N+1)
dp[0] = 1
for i in range(1,N+1):
    if i in A:
        continue
    if i == 1:
        dp[1] = dp[0]
    else:
        dp[i] = (dp[i-1]+dp[i-2])%MOD
print((dp[N]))
# Original solution
# input
N, M = list(map(int, input().split()))
a = []
a_append = a.append

for n in range(M):
    a_append(int(eval(input())))

mod = 1000000007

# check
check = {}
for n in range(N + 1):
    if n in a:
        check[n] = False
    else:
        check[n] = True

dp = {0: 1}
if check[1] is True:
    dp[1] = 1
else:
    dp[1] = 0

for n in range(2, N + 1):
    dp[n] = 0
    if check[n - 1] is True:
        dp[n] += dp[n - 1]
    if check[n - 2] is True:
        dp[n] += dp[n - 2]
    dp[n] %= mod

print((dp[N]))


# Optimized solution
# input
N, M = list(map(int, input().split()))
a = []
a_append = a.append

for n in range(M):
    a_append(int(eval(input())))

mod = 1000000007

# check
check = [True] * (N + 1)
for i in a:
    check[i] = False

dp = {0: 1}
if check[1] is True:
    dp[1] = 1
else:
    dp[1] = 0

for n in range(2, N + 1):
    dp[n] = 0
    if check[n - 1] is True:
        dp[n] += dp[n - 1]
    if check[n - 2] is True:
        dp[n] += dp[n - 2]
    dp[n] %= mod

print((dp[N]))
# Original solution
import bisect
n,m = list(map(int,input().split()))
p = [0]*(n+1)
mod = 10**9+7

a = [int(eval(input())) for i in range(m)]

p[0]=1

for i in range(1,n+1):
  k = bisect.bisect_left(a,i)
  k2 = bisect.bisect_right(a,i)
  if k == k2:
    p[i] += p[i-1]
    if i >= 2:
      p[i] += p[i-2]
    p[i] = p[i]%mod
#print(p)
print((p[-1]%mod))


# Optimized solution
import bisect
n,m = list(map(int,input().split()))
mod = 10**9+7

a = [int(eval(input())) for i in range(m)]

#dp[i]:i段目に来る場合の数
dp = [0]*(n+1)
dp[0]=1
for i in range(1,n+1):
  k = bisect.bisect_left(a,i)
  k2 = bisect.bisect_right(a,i)
  if k == k2:
    dp[i] += dp[i-1]
    if i >= 2:
      dp[i] += dp[i-2]
    dp[i] = dp[i]%mod
print((dp[-1]%mod))
# Original solution
MOD = 10**9 + 7

N, M = list(map(int,input().split()))
A = []
for _ in range(M):
    a = int(eval(input()))
    A.append(a)

dp = [1] * (N+1)

if 1 in A: dp[1] = 0

for i in range(N-1):
    if i+2 in A:
        dp[i+2] = 0
    else:
        dp[i+2] = (dp[i] + dp[i+1]) % MOD
    
print((dp[N]))

# Optimized solution
MOD = 10**9 + 7

N, M = list(map(int,input().split()))
A = set()
for _ in range(M):
    A.add(int(eval(input())))

dp = [1] * (N+1)

if 1 in A:
    dp[1] = 0

for i in range(N-1):
    if i+2 in A:
        dp[i+2] = 0
    else:
        dp[i+2] = (dp[i] + dp[i+1]) % MOD
    
print((dp[N]))
# Original solution
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]

nums = [0]*(N+1)
nums[0] = 1
if 1 not in a:
    nums[1] = 1
for i in range(2, N+1):
    if not i in a:
      nums[i] = nums[i-1] + nums[i-2]

print((nums[N]%(1000000007)))


# Optimized solution
N, M = list(map(int, input().split()))
a = set([int(eval(input())) for _ in range(M)])

nums = [0]*(N+1)
nums[0] = 1
if 1 not in a:
    nums[1] = 1
for i in range(2, N+1):
    if not i in a:
      nums[i] = nums[i-1] + nums[i-2]

print((nums[N]%(1000000007)))
# Original solution
def main():
    N, M = list(map(int, input().split()))
    A = []
    for i in range(M):
        A.append(int(eval(input())))

    mod = 1000000007

    dp = [0] * (N+1)
    dp[0] = 1
    for now in range(0, N):
        for next in range(now+1, min(N, now+2)+1):
            if next not in A:
                dp[next] += dp[now]
                #dp[next] %= mod

    print((dp[N] % mod))

if __name__ == '__main__':
    main()

# Optimized solution
def main():
    N, M = list(map(int, input().split()))
    A = set()
    for i in range(M):
        A.add(int(eval(input())))

    mod = 1000000007

    dp = [0] * (N+1)
    dp[0] = 1
    for now in range(0, N):
        for next in range(now+1, min(N, now+2)+1):
            if next not in A:
                dp[next] += dp[now]
                dp[next] %= mod

    print((dp[N] % mod))

if __name__ == '__main__':
    main()
# Original solution
n,m = list(map(int,input().split()))
stair = []
for i in range(m):
    stair.append(int(eval(input())))

ans = [0]*(n+1)
ans[0] = 1
ans[1] = 1
for i in range(n+1):
    if i in stair:
        ans[i] = 0
    else:
        if i ==0 or i==1:
            continue
        else:
            ans[i] = ans[i-2] + ans[i-1]
print((ans[n]%(10**9+7)))

# Optimized solution
n,m = list(map(int,input().split()))
ans = [1]*(n+1)
for i in range(m):
    a = int(eval(input()))
    ans[a] = 0
    
for i in range(2,n+1):
    if ans[i]==0:
        continue
    else:
        ans[i] = ans[i-2] + ans[i-1]
print((ans[n]%(10**9+7)))
# Original solution
n,m=list(map(int,input().split()))
a=[-1]
k=[1,1]
ansk=1
d=[]
renzoku=1
for i in range(m):
 a.append(int(eval(input())))
 if a[i+1]==a[i]+1:
    renzoku=0
a.append(n+1)
for i in range(max(a)):
 s=k[i+1]+k[i]
 k.append(s)
for i in range(m+1):
 d.append(a[i+1]-a[i]-1)
 ansk*=k[d[i]-1]
if renzoku==1:
 print((ansk%1000000007))
else:
 print((0))

# Optimized solution
def Fib(n):
    a=[0,1,1]
    if n<=2:
    	return a[n]
    else:
    	for i in range(n-2):
    		a.append(a[i+1]+a[i+2])
    	return a[n]
n,m=list(map(int,input().split()))
if m==0:
	print((Fib(n+1)%(10**9+7)))
	exit()
a=[]
for i in range(m):
	a.append(int(eval(input())))
if a[0]!=1:
	a.insert(0,-1)
if a[-1]!=n-1:
	a.append(n+1)
b=[]
for i in range(len(a)-1):
	b.append(a[i+1]-a[i]-1)
	if a[i+1]-a[i]==1:
		print((0))
		exit()
ans=1
for i in range(len(b)):
	ans*=Fib(b[i])
	ans%=10**9+7
print(ans)
# Original solution
def Fib(n):
    a=[0,1,1]
    if n<=2:
    	return a[n]
    else:
    	for i in range(n-2):
    		a.append(a[i+1]+a[i+2])
    	return a[n]
n,m=list(map(int,input().split()))
if m==0:
	print((Fib(n+1)%(10**9+7)))
	exit()
a=[]
for i in range(m):
	a.append(int(eval(input())))
if a[0]!=1:
	a.insert(0,-1)
if a[-1]!=n-1:
	a.append(n+1)
b=[]
for i in range(len(a)-1):
	b.append(a[i+1]-a[i]-1)
	if a[i+1]-a[i]==1:
		print((0))
		exit()
ans=1
for i in range(len(b)):
	ans*=Fib(b[i])
	ans%=10**9+7
print(ans)

# Optimized solution
mod=10**9+7
n,m=list(map(int,input().split()))
a=[int(eval(input()))for _ in range(m)]
a.append(n+1)
fib=[1,1]
for i in range(n):
	r=fib[-1]+fib[-2]
	fib.append(r%mod)
ans=1
now=0
for x in a:
	ans*=fib[x-1-now]
	if x-1-now<0:
		print((0))
		exit()
	ans%=mod
	now=x+1
print(ans)
# Original solution
MOD = 10**9 + 7

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

isBroken = [False] * (N+1)
for A in As:
    isBroken[A] = True

dp = [0] * (N+1)
dp[0] = 1
for i in range(1, N+1):
    if isBroken[i]: continue
    if i > 1:
        dp[i] += dp[i-2]
    dp[i] += dp[i-1]
    dp[i] %= MOD

print((dp[N]))


# Optimized solution
MOD = 10**9 + 7

N, M = list(map(int, input().split()))
setA = set([int(eval(input())) for _ in range(M)])

dp = [0] * (N+3)
dp[0] = 1
for i in range(N):
    if i in setA: continue
    dp[i] %= MOD
    dp[i+1] += dp[i]
    dp[i+2] += dp[i]

ans = dp[N] % MOD
print(ans)
# Original solution
Q = 1000000007
n, m = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(m)]
dp = {
    0: 1,
    1: 0 if 1 in a else 1
}

for k in range(2, n + 1):
    dp[k] = (0 if k in a else dp[k - 1] + dp[k - 2]) % Q


print((dp[n]))


# Optimized solution
Q = 1000000007
n, m = list(map(int, input().split()))
a = set([int(eval(input())) for _ in range(m)])
dp = {
    0: 1,
    1: 0 if 1 in a else 1
}

for k in range(2, n + 1):
    dp[k] = (0 if k in a else dp[k - 1] + dp[k - 2]) % Q


print((dp[n]))
# Original solution
n,m = list(map(int, input().split()))
DIV = 10**9+7
a = [0]*(n+1)
dp = [0]*(n+1)
dp[0] = 1
for _ in range(m):
    broken = int(eval(input()))
    a[broken] = 1
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2]) % DIV
    if a[i] == 1:
        dp[i] = 0
print((dp[n]))


# Optimized solution
n, m = list(map(int, input().split()))
# 壊れた場所を集合で持っておく
a = {int(eval(input())) for _ in range(m)}
route = [0] * (n + 1)
# route[2]のために初期値は1とする
route[0] = 1
for i in range(1, n + 1):
    # 壊れた場所でないなら、そこまでのルート数を計算
    if not (i in a):
        if i == 1:
            route[i] = 1
        else:
            route[i] = (route[i - 1] + route[i - 2]) % (10 ** 9 + 7)
print((route[n]))