#!/usr/bin/env python
import sys
N, M = map(int, input().split())
A = [int(input()) for i in range(M)]
m = 10**9+7
F = [0, 1]
for i in range(2, N+1):
    F.append(F[i-1]+F[i-2])

for i, a in enumerate(A[:-1]):
    if a+1 == A[i+1]:
        print(0)
        sys.exit()

ans = 1
s = 0
for i in range(N):
    if i in A:
        ans *= F[i-s]
        ans %= m
        s = i+1
ans *= F[N-s+1]
ans %= m 
print(ans)