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