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

dp=[0]*(N+3)

dp[0]=1

a=[0]*(N+3)

for i in range(M):

    a[int(eval(input()))]=1

mod=10**9+7



for i in range(N+1):

    if a[i+1] != 1:

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

        dp[i+1]%=mod

    if a[i+2] != 1:

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

        dp[i+2]%=mod



print((dp[N]))
N,M=list(map(int,input().split()))

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

tf=[0]*(N+1)

for i in a:

  tf[i]=1

dp=[0]*(N+1)

dp[0]=1

dp[1]=0 if 1 in a else 1

mod=10**9+7

 

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

    if tf[i] == 1:

        continue

    else:

        dp[i]=(dp[i-1]+dp[i-2])%mod

 

print((dp[N]))
N, M = list(map(int, input().split()))
dp = [0] * (N + 3)
dp[0] = 1
a = [0] * (N + 3)
for i in range(M):
    a[int(eval(input()))] = 1
mod = 10**9 + 7
for i in range(N + 1):
    if a[i + 1] != 1:
        dp[i + 1] += dp[i]
        dp[i + 1] %= mod
    if a[i + 2] != 1:
        dp[i + 2] += dp[i]
        dp[i + 2] %= mod
print((dp[N]))

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

-dp = [0] * (N + 3) +a = [int(eval(input())) for i in range(M)] +tf = [0] * (N + 1) +for i in a: +    tf[i] = 1 +dp = [0] * (N + 1) -a = [0] * (N + 3) -for i in range(M): -    a[int(eval(input()))] = 1 +dp[1] = 0 if 1 in a else 1 -for i in range(N + 1): -    if a[i + 1] != 1: -        dp[i + 1] += dp[i] -        dp[i + 1] %= mod -    if a[i + 2] != 1: -        dp[i + 2] += dp[i] -        dp[i + 2] %= mod +for i in range(2, N + 1): +    if tf[i] == 1: +        continue +    else: +        dp[i] = (dp[i - 1] + dp[i - 2]) % mod