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



mod = 10**9 + 7



no = [False] * (n+1)



for _ in range(m):

    a = int(eval(input()))

    no[a] = True

    

dp = [0] * (n+1)

dp[0] = 1



for i in range(n):

    if (no[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))

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

lis = [int(eval(input())) for _ in range(m)]

mod = 10**9+7



ans =[1] + [1] + [-1] * (n-1)



for i in lis:

    ans[i] = 0





for i in range(2, n+1):

    if ans[i] != 0:

        ans[i] = (ans[i-1] + ans[i-2]) % mod



print((ans[n]))
n, m = list(map(int, input().split()))
mod = 10**9 + 7
no = [False] * (n + 1)
for _ in range(m):
    a = int(eval(input()))
    no[a] = True
dp = [0] * (n + 1)
dp[0] = 1
for i in range(n):
    if no[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))

n, m = list(map(int, input().split()))
lis = [int(eval(input())) for _ in range(m)]
mod = 10**9 + 7
ans = [1] + [1] + [-1] * (n - 1)
for i in lis:
    ans[i] = 0
for i in range(2, n + 1):
    if ans[i] != 0:
        ans[i] = (ans[i - 1] + ans[i - 2]) % mod
print((ans[n]))

+lis = [int(eval(input())) for _ in range(m)] -no = [False] * (n + 1) -for _ in range(m): -    a = int(eval(input())) -    no[a] = True -dp = [0] * (n + 1) -dp[0] = 1 -for i in range(n): -    if no[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)) +ans = [1] + [1] + [-1] * (n - 1) +for i in lis: +    ans[i] = 0 +for i in range(2, n + 1): +    if ans[i] != 0: +        ans[i] = (ans[i - 1] + ans[i - 2]) % mod +print((ans[n]))