import sys
input = sys.stdin.readline
n,m = map(int,input().split())
num = 10**9+7
nots = [int(input()) for i in range(m)]
leng = len(nots)
cnt = 0
dp = [0]*(n+1)
dp[0] = 1
if leng > 0 and nots[0] == 1:
  dp[1] = 0
else:
  dp[1] = 1
if n < 2:
  print(1)
  exit()

for i in range(2,n+1):
  if leng > 0 and nots[cnt] == i:
    dp[i] = 0
  else:
    dp[i] = dp[i-1] + dp[i-2]
  if nots[cnt] < i and cnt < leng - 1:
    cnt += 1
print(dp[n] % num)