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

MOD = 1000000007 

D=[0] * (n + 1)

for _ in range(m):

    D[int(eval(input()))] = -1

for i in range(n+1):

    if D[i] == -1:

        continue

    if i in (0, 1):

        D[i] = 1

        continue

    if D[i-1] != -1:

        D[i] += D[i-1]

    if D[i-2] != -1:

        D[i] += D[i-2]

    D[i]%=MOD

print((D[i] % MOD))
n,m=list(map(int,input().split()))

D=[1] * (n + 1)

for _ in range(m):

    D[int(eval(input()))] = 0

for i in range(n+1):

    if D[i] == 0 or i < 2:

        continue

    D[i] = (D[i-1] + D[i-2]) % 1000000007 

print((D[i]))
n, m = list(map(int, input().split()))
MOD = 1000000007
D = [0] * (n + 1)
for _ in range(m):
    D[int(eval(input()))] = -1
for i in range(n + 1):
    if D[i] == -1:
        continue
    if i in (0, 1):
        D[i] = 1
        continue
    if D[i - 1] != -1:
        D[i] += D[i - 1]
    if D[i - 2] != -1:
        D[i] += D[i - 2]
    D[i] %= MOD
print((D[i] % MOD))

n, m = list(map(int, input().split()))
D = [1] * (n + 1)
for _ in range(m):
    D[int(eval(input()))] = 0
for i in range(n + 1):
    if D[i] == 0 or i < 2:
        continue
    D[i] = (D[i - 1] + D[i - 2]) % 1000000007
print((D[i]))

-MOD = 1000000007 -D = [0] * (n + 1) +D = [1] * (n + 1) -    D[int(eval(input()))] = -1 +    D[int(eval(input()))] = 0 -    if D[i] == -1: +    if D[i] == 0 or i < 2: -    if i in (0, 1): -        D[i] = 1 -        continue -    if D[i - 1] != -1: -        D[i] += D[i - 1] -    if D[i - 2] != -1: -        D[i] += D[i - 2] -    D[i] %= MOD -print((D[i] % MOD)) +    D[i] = (D[i - 1] + D[i - 2]) % 1000000007 +print((D[i]))