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

oks = [True] * (N+1)



for _ in range(M):

    a = int(eval(input()))

    oks[a] = False



dp = [1] + [0] * N

for now in range(N):

    for nxt in range(now+1, min(N, now+2)+1):

        if oks[nxt]:

            dp[nxt] += dp[now]

            dp[nxt] %= 1e9 + 7



print((int(dp[N])))
MOD = 10**9 + 7

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

a = [int(eval(input())) for _ in range(M)] + [N + 1]

dp = [0] * (N + 1)

dp[0] = 1

s = -1



for broken in a:

    for j in range(s + 1, broken):

        if j > s + 1:

            dp[j] += dp[j - 1] % MOD

        if j > 1:

            dp[j] += dp[j - 2] % MOD

        dp[j] %= MOD

    s = broken



print((dp[-1]))
N, M = list(map(int, input().split()))
oks = [True] * (N + 1)
for _ in range(M):
    a = int(eval(input()))
    oks[a] = False
dp = [1] + [0] * N
for now in range(N):
    for nxt in range(now + 1, min(N, now + 2) + 1):
        if oks[nxt]:
            dp[nxt] += dp[now]
            dp[nxt] %= 1e9 + 7
print((int(dp[N])))

MOD = 10**9 + 7
N, M = list(map(int, input().split()))
a = [int(eval(input())) for _ in range(M)] + [N + 1]
dp = [0] * (N + 1)
dp[0] = 1
s = -1
for broken in a:
    for j in range(s + 1, broken):
        if j > s + 1:
            dp[j] += dp[j - 1] % MOD
        if j > 1:
            dp[j] += dp[j - 2] % MOD
        dp[j] %= MOD
    s = broken
print((dp[-1]))

+MOD = 10**9 + 7 -oks = [True] * (N + 1) -for _ in range(M): -    a = int(eval(input())) -    oks[a] = False -dp = [1] + [0] * N -for now in range(N): -    for nxt in range(now + 1, min(N, now + 2) + 1): -        if oks[nxt]: -            dp[nxt] += dp[now] -            dp[nxt] %= 1e9 + 7 -print((int(dp[N]))) +a = [int(eval(input())) for _ in range(M)] + [N + 1] +dp = [0] * (N + 1) +dp[0] = 1 +s = -1 +for broken in a: +    for j in range(s + 1, broken): +        if j > s + 1: +            dp[j] += dp[j - 1] % MOD +        if j > 1: +            dp[j] += dp[j - 2] % MOD +        dp[j] %= MOD +    s = broken +print((dp[-1]))