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

mod = 10 **9 + 7

broken = [0] * M

for i in range(M):

    broken[i] = int(eval(input()))



dp = [0] * (N+3)

dp[0] = 1

for i in range(M):

    dp[broken[i]] = -1 * float('inf')



for i in range(N):

    if dp[i] >= 0:

        dp[i+1] = (dp[i+1] + dp[i]) % mod

        dp[i+2] = (dp[i+2] + dp[i]) % mod



print((dp[N] % mod))

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

mod = 10 ** 9 + 7

dp = [0] * (N+3)

dp[0] = 1

for i in range(M):

    dp[int(eval(input()))] = 0.5



for i in range(N):

    if dp[i] % 1 == 0:

        dp[i+1] = (dp[i+1] + dp[i]) % mod

        dp[i+2] = (dp[i+2] + dp[i]) % mod



print((dp[N] % mod))

N, M = list(map(int, input().split()))
mod = 10**9 + 7
broken = [0] * M
for i in range(M):
    broken[i] = int(eval(input()))
dp = [0] * (N + 3)
dp[0] = 1
for i in range(M):
    dp[broken[i]] = -1 * float("inf")
for i in range(N):
    if dp[i] >= 0:
        dp[i + 1] = (dp[i + 1] + dp[i]) % mod
        dp[i + 2] = (dp[i + 2] + dp[i]) % mod
print((dp[N] % mod))

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

-broken = [0] * M -for i in range(M): -    broken[i] = int(eval(input())) -    dp[broken[i]] = -1 * float("inf") +    dp[int(eval(input()))] = 0.5 -    if dp[i] >= 0: +    if dp[i] % 1 == 0: