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

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

mod =  1000000007

ret = [-1] * (N+1)

ret[0] = 1

for i in a:

    ret[i] = 0



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

    if ret[i] == 0:

        continue

    elif i == 1:

        ret[1] = 1

    else:

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



print((ret[len(ret)-1]%mod))

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

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

mod =  1000000007

ret = [0] * (N+1)

ret[0] = 1

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

    if i in a:

        continue

    elif i == 1:

        ret[1] = 1

    else:

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



print((ret[len(ret)-1]%mod))

N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)]
mod = 1000000007
ret = [-1] * (N + 1)
ret[0] = 1
for i in a:
    ret[i] = 0
for i in range(1, N + 1):
    if ret[i] == 0:
        continue
    elif i == 1:
        ret[1] = 1
    else:
        ret[i] = ret[i - 2] + ret[i - 1]
print((ret[len(ret) - 1] % mod))

N, M = list(map(int, input().split()))
a = set([int(eval(input())) for _ in range(M)])
mod = 1000000007
ret = [0] * (N + 1)
ret[0] = 1
for i in range(1, N + 1):
    if i in a:
        continue
    elif i == 1:
        ret[1] = 1
    else:
        ret[i] = ret[i - 2] + ret[i - 1]
print((ret[len(ret) - 1] % mod))

-a = [int(eval(input())) for _ in range(M)] +a = set([int(eval(input())) for _ in range(M)]) -ret = [-1] * (N + 1) +ret = [0] * (N + 1) -for i in a: -    ret[i] = 0 -    if ret[i] == 0: +    if i in a: