N,M=map(int,input().split())
a=[0]
for _ in range(M):
    a.append(int(input()))

b=[]
b.append(a[1]-a[0]-1)
for i in range(1,M):
    if a[i+1]-a[i]==1:
        b.append(0)
    else:
        b.append(a[i+1]-a[i]-2)
b.append(N-a[M]-1)

num=max(b)

mod=1000000007

def fib(n,num):
    fib=[0 for i in range(num+10)]
    fib[0]=1
    fib[1]=1
    for i in range(2,num+1):
        fib[i]=fib[i-1]+fib[i-2]
    return fib[n]
p=1
for j in range(M+1):
    p*=fib(b[j],num)

if 0 in b[1:]:
    print(0)
else:
    print(p%mod)