n,m=map(int,input().split())
a=[]
b=0
c=0
d=1
e=0
for i in range(m):
    a.append(int(input()))
for j in range(m-1):
    if(a[j]+1==a[j+1]):
        print('0')
        break    
z=list(set(a))
z=sorted(z)
z.append(0)     
for i in range(n):
    if(z[b]==i+1):
        b+=1    
        continue    
    else:
        c=d+e
        e=d
        d=c
print({0}.format(c%100000007)