n,m=map(int,input().split())

arr=[]
mod=pow(10,9)+7
for i in range(m):
    a=int(input())
    arr.append(a)

step=[int(i) for i in range(n+1)]
step[0]=1
step[1]=1
i=2
f=0
while i<=n:
    if i not in arr:
        if (i-1) in arr and (i-2) in arr:
            f+=1
            break
        else:
            if (i-1) not in arr and (i-2) not in arr:
                step[i]=step[i-1]+step[i-2]
            elif (i-1) not in arr and (i-2) in arr:
                step[i]=step[i-1]        
            elif (i-1) in arr and (i-2) not in arr:
                step[i]=step[i-2]


    i+=1  


#print(step)
if f!=0:
    print(0)
else:    
    print((step[n])%mod)           