from sys import exit
import sys
sys.setrecursionlimit(10000)

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

_a = -1
a = []
ans = 0

for _ in range(M):
    a_ = int(input())
    if _a + 1 == a_:
        print(0)
        exit()
    _a = a_
    a.append(_a)


step = [1]

for s in range(1, N + 1):
    if s in a:
        step.append(0)
        continue
    if s == 1:
        step.append(1)
        continue
    else:
        step.append(step[s - 1] + step[s - 2])

print(step[N] % 1000000007)
