import math
from functools import lru_cache

MOD = 1000000007


@lru_cache(None)
def fibo(x):
    if x <= 1:
        return 1
    return fibo(x - 2) + fibo(x - 1)


n, m = list(map(int, input().split(" ")))
a_list = [int(input()) for _ in range(m)]
ngs = [i in a_list for i in range(n)]
ngs.append(False)
for i in range(n):
    if ngs[i] and ngs[i + 1]:
        print(0)
        exit()
cnts = []
cnt = 0

for ng in ngs:
    if ng:
        cnts.append(cnt)
        cnt = 0
        continue
    cnt += 1
cnts.append(cnt)
ans = 1
for c in cnts:
    if c != 0:
        ans *= fibo(c - 1)
# print(ngs)
# print(cnts)
print(ans % MOD)
