from sys import exit
import sys

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

_a = -1
B = []
ans = 0
count = 0

for i in range(M):
    a_ = int(input())
    if _a + 1 == a_:
        print(0)
        exit()
    _a = a_
    N -= 2
    count += 1
    B.append(_a + 2 - 2 * count)


step = [1]

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

print(step[N] % 1000000007)
