n,m = map(int,input().split())
a = [0]
lim = int((1e+9)+7)
fibo = [1,1]
def f(num):
    if len(fibo) < num+1:
        while(len(fibo) <= num):
            fibo.append((fibo[-1]+fibo[-2])%lim)
    return fibo[num]

for _ in range(m):
    a.append(int(input()))
for i in range(1,len(a)-1):
    if a[i+1]-a[i] == 1:
        print(0)
        exit()

a.append(n)

d = []
for i in range(len(a)-1):
    d.append((a[i+1]-a[i])-1)
ansf = 1
for i in range(len(d)):
    if i == 0:
        ansf = (ansf * f(d[i]))%lim
    elif i == len(d)-1:
        ansf = (ansf * f(d[i]))%lim
    else:
        ansf = (ansf * f(d[i]-1))%lim
print(ansf)