n,m = map(int, input().split())
listA = [int(input()) for i in range(m)]
if(listA.count(1)==1 and listA.count(2)==1):
    a,b = 0,0
elif(listA.count(1)==1):
    a,b = 0,1
elif(listA.count(2)==1):
    a,b = 1,0
else:
    a,b = 1,2
    
for j in range(1, n-1):
    if(listA.count(j+2)!=0):
        a,b = b,0
    if(listA.count(j+2)==0):
        a,b = b,a+b

print(b%1000000007)

