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

dp=[0]*(n+3)

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

mod=10**9+7

for i in range(m):

    dp[a[i]]=-1



dp[0]=1

if dp[1]!=-1:

    dp[1]+=dp[0]



for i in range(n+1):

    if dp[i+2]==-1:

        continue

    if dp[i]!=-1:

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

    if dp[i+1]!=-1:

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

    dp[i+2]%=mod

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

a = []

stairs = [0]*(n+2)

for _ in range(m):

    a = int(eval(input()))

    stairs[a] = 1

mod = 10**9 + 7



dp = [0]*(n+2)

dp[0] = 1



for i in range(n):

    if i <= 1:

        if stairs[i+1] == 0:

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

            dp[i+1] %= mod

            stairs[i+1] = 1

    if stairs[i+2] == 0:

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

        dp[i+2] %= mod

        stairs[i+2] = 1



print((dp[n]%mod))

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

n, m = list(map(int, input().split()))
a = []
stairs = [0] * (n + 2)
for _ in range(m):
    a = int(eval(input()))
    stairs[a] = 1
mod = 10**9 + 7
dp = [0] * (n + 2)
dp[0] = 1
for i in range(n):
    if i <= 1:
        if stairs[i + 1] == 0:
            dp[i + 1] += dp[i]
            dp[i + 1] %= mod
            stairs[i + 1] = 1
    if stairs[i + 2] == 0:
        dp[i + 2] += dp[i + 1] + dp[i]
        dp[i + 2] %= mod
        stairs[i + 2] = 1
print((dp[n] % mod))

-dp = [0] * (n + 3) -a = [int(eval(input())) for i in range(m)] +a = [] +stairs = [0] * (n + 2) +for _ in range(m): +    a = int(eval(input())) +    stairs[a] = 1 -for i in range(m): -    dp[a[i]] = -1 +dp = [0] * (n + 2) -if dp[1] != -1: -    dp[1] += dp[0] -for i in range(n + 1): -    if dp[i + 2] == -1: -        continue -    if dp[i] != -1: -        dp[i + 2] += dp[i] -    if dp[i + 1] != -1: -        dp[i + 2] += dp[i + 1] -    dp[i + 2] %= mod +for i in range(n): +    if i <= 1: +        if stairs[i + 1] == 0: +            dp[i + 1] += dp[i] +            dp[i + 1] %= mod +            stairs[i + 1] = 1 +    if stairs[i + 2] == 0: +        dp[i + 2] += dp[i + 1] + dp[i] +        dp[i + 2] %= mod +        stairs[i + 2] = 1