n,m = map(int,input().split())
base = [int(input()) for i in range(m)]
count = 0
now = 0
i= 0

dp = [0]*(n+1)
if 1 in base:
  dp[1] = 0
else:
  dp[1] = 1

dp[0] = 1

for i in range(2,n+1):
  if not(i in base):
    dp[i] = dp[i-1] + dp[i-2]
  
  
print(int(dp[n]%1000000007))