from collections import defaultdict

N, M = [int(x) for x in input().split()]
a = []

for _ in range(M):
    a.append(int(input()))

MOD = 1000000007

dict = defaultdict(int)
ans = 1
dict[0] = 1
for i in range(N):
    if not a.count(i + 1):
        dict[i + 1] += dict[i]
    if not a.count(i + 2):
        dict[i + 2] += dict[i]
    if a.count(i + 1) and a.count(i + 2):
        print("0")
        exit()


print(dict[N] % MOD)


