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

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

print(b)

num=max(b)

mod=1000000007

fib=[0 for i in range(num+10)]
print(fib)
fib[0]=1
fib[1]=1
for i in range(2,num+1):
    fib[i]=fib[i-1]+fib[i-2]

if -1 in b:
    print(0)
else:
    p=1
    for j in range(M+1):
        p*=fib[b[j]]
    print(p%mod)