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

A = [int(eval(input())) for _ in range(M)]



B = [-1] + A + [N + 1]

B = [B[i + 1] - B[i] - 2 for i in range(M + 1)]



total = max(B)

dp = [1, 1] + [0] * (total - 1)

for i in range(total - 1):

    dp[i + 2] = (dp[i + 1] + dp[i]) % (10 ** 9 + 7)

        

ans = 1

for i in range(M + 1):

    ans *= dp[B[i]]

    ans %= 10 ** 9 + 7

print((ans if -1 not in B[1:] else 0))


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

X = [int(eval(input())) for _ in range(M)]



MOD = 10 ** 9 + 7

dp = [-1] * (N + 1)

dp[0] = 1

for i in range(M):

    dp[X[i]] = 0



for i in range(N):

    if dp[i + 1] < 0:

        if i == 0:

            dp[i + 1] = dp[i]

        else:

            dp[i + 1] = (dp[i] + dp[i - 1]) % MOD



print((dp[-1]))

N, M = list(map(int, input().split()))
A = [int(eval(input())) for _ in range(M)]
B = [-1] + A + [N + 1]
B = [B[i + 1] - B[i] - 2 for i in range(M + 1)]
total = max(B)
dp = [1, 1] + [0] * (total - 1)
for i in range(total - 1):
    dp[i + 2] = (dp[i + 1] + dp[i]) % (10**9 + 7)
ans = 1
for i in range(M + 1):
    ans *= dp[B[i]]
    ans %= 10**9 + 7
print((ans if -1 not in B[1:] else 0))

N, M = list(map(int, input().split()))
X = [int(eval(input())) for _ in range(M)]
MOD = 10**9 + 7
dp = [-1] * (N + 1)
dp[0] = 1
for i in range(M):
    dp[X[i]] = 0
for i in range(N):
    if dp[i + 1] < 0:
        if i == 0:
            dp[i + 1] = dp[i]
        else:
            dp[i + 1] = (dp[i] + dp[i - 1]) % MOD
print((dp[-1]))

-A = [int(eval(input())) for _ in range(M)] -B = [-1] + A + [N + 1] -B = [B[i + 1] - B[i] - 2 for i in range(M + 1)] -total = max(B) -dp = [1, 1] + [0] * (total - 1) -for i in range(total - 1): -    dp[i + 2] = (dp[i + 1] + dp[i]) % (10**9 + 7) -ans = 1 -for i in range(M + 1): -    ans *= dp[B[i]] -    ans %= 10**9 + 7 -print((ans if -1 not in B[1:] else 0)) +X = [int(eval(input())) for _ in range(M)] +MOD = 10**9 + 7 +dp = [-1] * (N + 1) +dp[0] = 1 +for i in range(M): +    dp[X[i]] = 0 +for i in range(N): +    if dp[i + 1] < 0: +        if i == 0: +            dp[i + 1] = dp[i] +        else: +            dp[i + 1] = (dp[i] + dp[i - 1]) % MOD +print((dp[-1]))