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

mod = 10 ** 9 + 7

dp = [0] * (N+1)

dp[0] = 1

idx = 0

for m in range(M):

    a = int(eval(input()))

    for i in range(idx+1, a):

        dp[i] = dp[i-1] + dp[i-2]

        dp[i] %= mod

    idx = a



for i in range(idx+1, N+1):

    dp[i] = dp[i-1] + dp[i-2]

    dp[i] %= mod



print((dp[-1]))
N, M = list(map(int, input().split()))

mod = 10 ** 9 + 7

A = [True] * (N+1)

for _ in range(M):

    a = int(eval(input()))

    A[a] = False

dp = [0] * (N+1)

dp[:2] = 1, 1 if A[1] else 0

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

    if A[i]:

        dp[i] = dp[i-1] + dp[i-2]

        dp[i] %= mod

print((dp[N]))
N, M = list(map(int, input().split()))
mod = 10**9 + 7
dp = [0] * (N + 1)
dp[0] = 1
idx = 0
for m in range(M):
    a = int(eval(input()))
    for i in range(idx + 1, a):
        dp[i] = dp[i - 1] + dp[i - 2]
        dp[i] %= mod
    idx = a
for i in range(idx + 1, N + 1):
    dp[i] = dp[i - 1] + dp[i - 2]
    dp[i] %= mod
print((dp[-1]))

N, M = list(map(int, input().split()))
mod = 10**9 + 7
A = [True] * (N + 1)
for _ in range(M):
    a = int(eval(input()))
    A[a] = False
dp = [0] * (N + 1)
dp[:2] = 1, 1 if A[1] else 0
for i in range(2, N + 1):
    if A[i]:
        dp[i] = dp[i - 1] + dp[i - 2]
        dp[i] %= mod
print((dp[N]))

+A = [True] * (N + 1) +for _ in range(M): +    a = int(eval(input())) +    A[a] = False -dp[0] = 1 -idx = 0 -for m in range(M): -    a = int(eval(input())) -    for i in range(idx + 1, a): +dp[:2] = 1, 1 if A[1] else 0 +for i in range(2, N + 1): +    if A[i]: -    idx = a -for i in range(idx + 1, N + 1): -    dp[i] = dp[i - 1] + dp[i - 2] -    dp[i] %= mod -print((dp[-1])) +print((dp[N]))