F = [1,1]

def fibo(n):
    if n <= len(F):
        return F[n-1]
    while len(F) < n:
        F.append(F[-1] + F[-2])
    return F[n-1]

N, M = list(map(int, input().split()))
A = [int(input()) for _ in range(M)]
MOD = 1000000007

B = [A[0]]
for i in range(M-1):
    B.append(A[i+1] - A[i] - 1)
B.append(N - A[M-1])
ans = 1
if 0 in B:
    ans = 0
else:
    for n in B:
        ans *= fibo(n)
print(ans % MOD)
