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

for j in range(1, n-1):
    if(listB[j+2]!=0):
        a,b = b,0
    if(listB[j+2]==0):
        a,b = b,a+b

print(b%1000000007)