p=10**9+7
N,M=map(int,input().split())
a=[]
for i in range(M):
    a.append(int(input()))
x=[0 for i in range(N+1)]
x[0]=1
if 1 in a:
    x[1]=0
else:
    x[1]=x[0]
for i in range(2,N+1):
    x[i]=((x[i-1] if i-1 not in a else 0)+(x[i-2] if i-2 not in a else 0))%p

print(x[N])