n,m=map(int,input().split())
a=list(int(input()) for i in range (m))
x=[0]*n
if a[0]==1:
    x[0]=0
else:
    x[0]=1

if m>=2:
	if a[0]!=2 and a[1]!=2:
		x[1]=x[0]+1

if m==1:
    if a[0]!=2:
	       x[1]=x[0]+1

if n>=3:
    for k in range(2,n):
        for z in range(m):
            x[a[z]-1]=0
        x[k]=x[k-2]+x[k-1]
else:
    x[2]=x[1]+x[0]
print(x[n-1]%1000000007)