N, M = map(int, input().split())
mod = 10**9 + 7
a = [int(input()) for _ in range(M)]

b = [0] * N
b[0] = 1
b[1] = 2
for i in range(2, N):
    b[i] = b[i-1] + b[i-2]
b = [1] + b


for i in range(M-1):
    if a[i] + 1 == a[i+1]:
        print(0)
        quit()


a = [0] + a
if M == 0:
    ans = b[N]
    print(ans)
    quit()
else:
    ans = b[a[1] - a[0] -1]
for i in range(2, M+1):
    ans *= b[a[i]-1 - a[i-1]- 1]

ans *= b[N - a[M] -1]
print(ans % mod)