from functools import reduce
from operator import mul 
n,m = map(int, input().split())
al = list(map(int, [input() for i in range(m)]))
al.append(n + 1)
pl = []
pre = 0
for elm in al:
    if elm == 1:
        pre = elm + 1
        continue
    max = elm - 1 - pre
    res = 0
    f0 = 0
    f1 = 1
    for i in range(max):
        res = f0 + f1
        f0 = f1
        f1 = res
    pl.append(res)
    pre = elm + 1

print(reduce(mul, pl) % 1000000007)