MOD = 10**9 + 7



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



ban = [False] * (n + 1)



for i in range(m):

    a = int(eval(input()))

    ban[a] = True



dp = [0] * (n + 1)

dp[0] = 1



for i in range(n):

    dp[i] %= MOD

    if ban[i]:dp[i] = 0

    #print(i, dp[i])

    if i + 1 <= n:

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

    if i + 2 <= n:

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



print((dp[n] % MOD))

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

dp = [0] * (n+1) + [0] * 10



mod = 10**9 + 7

for i in range(m):

    dp[int(eval(input()))] = -1 # 壊れているので、-1としておこう?



dp[0] = 0 # 0段目にいるとしよう

# 1段目が行けなかったら...?

dp[1] = 1 if dp[1] != -1 else -1 # 1段目にいく方法は1通り?

dp[2] = -1 if dp[2] == -1 else (1 if dp[2] != -1 and dp[1] == -1 else 2) # 2段目に行く方法は2通り?

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

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

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

        dp[i] %= mod

    if i > 1:

        if dp[i] != -1 and dp[i-2] != -1:

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

            dp[i] %= mod

#print(dp)

print((dp[n]%mod))

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

n, m = list(map(int, input().split()))
dp = [0] * (n + 1) + [0] * 10
mod = 10**9 + 7
for i in range(m):
    dp[int(eval(input()))] = -1  # 壊れているので、-1としておこう?
dp[0] = 0  # 0段目にいるとしよう
# 1段目が行けなかったら...?
dp[1] = 1 if dp[1] != -1 else -1  # 1段目にいく方法は1通り?
dp[2] = (
    -1 if dp[2] == -1 else (1 if dp[2] != -1 and dp[1] == -1 else 2)
)  # 2段目に行く方法は2通り?
for i in range(3, n + 1):
    if dp[i] != -1 and dp[i - 1] != -1:
        dp[i] += dp[i - 1]
        dp[i] %= mod
    if i > 1:
        if dp[i] != -1 and dp[i - 2] != -1:
            dp[i] += dp[i - 2]
            dp[i] %= mod
# print(dp)
print((dp[n] % mod))

-MOD = 10**9 + 7 -ban = [False] * (n + 1) +dp = [0] * (n + 1) + [0] * 10 +mod = 10**9 + 7 -    a = int(eval(input())) -    ban[a] = True -dp = [0] * (n + 1) -dp[0] = 1 -for i in range(n): -    dp[i] %= MOD -    if ban[i]: -        dp[i] = 0 -    # print(i, dp[i]) -    if i + 1 <= n: -        dp[i + 1] += dp[i] -    if i + 2 <= n: -        dp[i + 2] += dp[i] -print((dp[n] % MOD)) +    dp[int(eval(input()))] = -1  # 壊れているので、-1としておこう? +dp[0] = 0  # 0段目にいるとしよう +# 1段目が行けなかったら...? +dp[1] = 1 if dp[1] != -1 else -1  # 1段目にいく方法は1通り? +dp[2] = ( +    -1 if dp[2] == -1 else (1 if dp[2] != -1 and dp[1] == -1 else 2) +)  # 2段目に行く方法は2通り? +for i in range(3, n + 1): +    if dp[i] != -1 and dp[i - 1] != -1: +        dp[i] += dp[i - 1] +        dp[i] %= mod +    if i > 1: +        if dp[i] != -1 and dp[i - 2] != -1: +            dp[i] += dp[i - 2] +            dp[i] %= mod +# print(dp) +print((dp[n] % mod))