n,m=map(int,input().split())
a=[int(input()) for _ in range(m)]
fib=[0]*(n+2)
fib[0]=1
fib[1]=[1,0][a.count(1)]
for i in range(2,n+1):
  fib[i]=[fib[i-1]+fib[i-2],0][a.count(i)]
  fib[i]%=10**9+7
print(fib[n])