N,M=list(map(int,input().split()))

S=[]
s=0
for m in range(M):
    e = int(input())
    S.append(list(range(s,e)))
    s = e+1

e = int(N+1)
S.append(list(range(s,e)))

fibo=[0,1]
for n in range(2,N+1):
    fibo.append(fibo[n-2]+fibo[n-1])
    
ans=1
for s in S:
    ans=ans*fibo[len(s)]
print(ans%1000000007)