n, m = [int(e) for e in input().split()]

a = set(int(eval(input())) for i in range(m))

t = [0] * (n + 2)

t[0] = 1

for i in range(n):

  if i in a:

    t[i] = 0

  else:

    t[i + 1] = (t[i + 1] + t[i]) % 1000000007

    t[i + 2] = (t[i + 2] + t[i]) % 1000000007

print((t[n]))

# DP(動的計画法)

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

A = set(int(eval(input())) for _ in range(M))



m = 1000000007



t = [0] * (N + 2)

t[0] = 1

for i in range(N):

    if i in A:

        t[i] = 0

    else:

        t[i + 1] = (t[i + 1] + t[i]) % m

        t[i + 2] = (t[i + 2] + t[i]) % m

print((t[N]))

n, m = [int(e) for e in input().split()]
a = set(int(eval(input())) for i in range(m))
t = [0] * (n + 2)
t[0] = 1
for i in range(n):
    if i in a:
        t[i] = 0
    else:
        t[i + 1] = (t[i + 1] + t[i]) % 1000000007
        t[i + 2] = (t[i + 2] + t[i]) % 1000000007
print((t[n]))

# DP(動的計画法)
N, M = list(map(int, input().split()))
A = set(int(eval(input())) for _ in range(M))
m = 1000000007
t = [0] * (N + 2)
t[0] = 1
for i in range(N):
    if i in A:
        t[i] = 0
    else:
        t[i + 1] = (t[i + 1] + t[i]) % m
        t[i + 2] = (t[i + 2] + t[i]) % m
print((t[N]))

-n, m = [int(e) for e in input().split()] -a = set(int(eval(input())) for i in range(m)) -t = [0] * (n + 2) +# DP(動的計画法) +N, M = list(map(int, input().split())) +A = set(int(eval(input())) for _ in range(M)) +m = 1000000007 +t = [0] * (N + 2) -for i in range(n): -    if i in a: +for i in range(N): +    if i in A: -        t[i + 1] = (t[i + 1] + t[i]) % 1000000007 -        t[i + 2] = (t[i + 2] + t[i]) % 1000000007 -print((t[n])) +        t[i + 1] = (t[i + 1] + t[i]) % m +        t[i + 2] = (t[i + 2] + t[i]) % m +print((t[N]))