n,m=map(int,input().split())
a=[-1]
k=[1,1]
ansk=1
d=[]
renzoku=1
for i in range(m):
 a.append(int(input()))
 if a[i+1]==a[i]+1:
    renzoku=0
a.append(n+1)
for i in range(max(a)):
 s=k[i+1]+k[i]
 k.append(s)
for i in range(m+1):
 d.append(a[i+1]-a[i]-1)
 ansk*=k[d[i]-1]
if renzoku==1:
 print(ansk%1000000007)
else:
 print(0)