mod = 10**9+7

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

l = [int(eval(input())) for _ in range(m)]



t2 = 0

t1 = 1



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

  if l == [] or i != l[0]:

    t0 = (t2+t1)%mod

  else:

    l.pop(0)

    t0 = 0

  t2 = t1

  t1 = t0



print(t0)
mod = 10**9+7

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

l = [0]*n

for _ in range(m):

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



s = 0

t = 1



for i in range(n):

  if l[i] > 0:

    t, s = 0, t

  else:

    t, s = (s+t)%mod, t



print(t)
mod = 10**9 + 7
n, m = list(map(int, input().split()))
l = [int(eval(input())) for _ in range(m)]
t2 = 0
t1 = 1
for i in range(1, n + 1):
    if l == [] or i != l[0]:
        t0 = (t2 + t1) % mod
    else:
        l.pop(0)
        t0 = 0
    t2 = t1
    t1 = t0
print(t0)

mod = 10**9 + 7
n, m = list(map(int, input().split()))
l = [0] * n
for _ in range(m):
    l[int(eval(input())) - 1] = 1
s = 0
t = 1
for i in range(n):
    if l[i] > 0:
        t, s = 0, t
    else:
        t, s = (s + t) % mod, t
print(t)

-l = [int(eval(input())) for _ in range(m)] -t2 = 0 -t1 = 1 -for i in range(1, n + 1): -    if l == [] or i != l[0]: -        t0 = (t2 + t1) % mod +l = [0] * n +for _ in range(m): +    l[int(eval(input())) - 1] = 1 +s = 0 +t = 1 +for i in range(n): +    if l[i] > 0: +        t, s = 0, t -        l.pop(0) -        t0 = 0 -    t2 = t1 -    t1 = t0 -print(t0) +        t, s = (s + t) % mod, t +print(t)