n,m=map(int,input().split())
a=[]
for i in range(m):
    a.append(int(input()))

inf=1000000007

l=[1,1]
for i in range(n+2):
    l.append((l[i]+l[i+1])%inf)

k=[a[0]]
for i in range(m-1):
    k.append(a[i+1]-a[i]-1)
k.append(n-a[m-1])

flag=True
for i in range(1,len(k)):
   if k[i]==0:
        flag=False
ans=1

for j in range(len(k)):
    ans=(ans*l[k[j]-1])%inf

if flag:
    print(ans%inf)
else:
    print(0)
