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

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

broken = set(a)

dp=[0]*(n+1)

mod = 10**9 + 7

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

  if i in broken:

    continue

  else:

    if i==n or i==n-1:

      dp[i]=1

    else:

      dp[i]=dp[i+1]+dp[i+2]

print((dp[0]%mod))
n,m=list(map(int,input().split()))

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

broken = set(a)

dp=[0]*(n+1)

mod = 10**9 + 7



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

  if i in broken:

    continue

  elif i==n or i==n-1:

    dp[i]=1

  else:

    dp[i]=dp[i+1]+dp[i+2]

    dp[i]%=mod

print((dp[0]))
n, m = list(map(int, input().split()))
a = [int(eval(input())) for i in range(m)]
broken = set(a)
dp = [0] * (n + 1)
mod = 10**9 + 7
for i in range(n, -1, -1):
    if i in broken:
        continue
    else:
        if i == n or i == n - 1:
            dp[i] = 1
        else:
            dp[i] = dp[i + 1] + dp[i + 2]
print((dp[0] % mod))

n, m = list(map(int, input().split()))
a = [int(eval(input())) for i in range(m)]
broken = set(a)
dp = [0] * (n + 1)
mod = 10**9 + 7
for i in range(n, -1, -1):
    if i in broken:
        continue
    elif i == n or i == n - 1:
        dp[i] = 1
    else:
        dp[i] = dp[i + 1] + dp[i + 2]
        dp[i] %= mod
print((dp[0]))

+    elif i == n or i == n - 1: +        dp[i] = 1 -        if i == n or i == n - 1: -            dp[i] = 1 -        else: -            dp[i] = dp[i + 1] + dp[i + 2] -print((dp[0] % mod)) +        dp[i] = dp[i + 1] + dp[i + 2] +        dp[i] %= mod +print((dp[0]))