n, m = map(int, input().split())
alist = set([int(input()) for _ in range(m)])

MOD = pow(10, 9) + 7

memo = [0 for _ in range(n)]
memo[0] = 0 if 1 in alist else 1
is_reach = True
if 1 in alist and 2 in alist:
  is_reach = False
  memo[0] = 0
elif 1 in alist:
  memo[1] = 1
else:
  memo[1] = 2

for i in range(2, n):
  if i+1 in alist:
    memo[i] = 0
  elif i in alist and i-1 in alist:
    memo[i] = 0
    is_reach = False
    break
  elif i in alist:
    memo[i] = memo[i-2]
  elif i-1 in alist:
    memo[i] = memo[i-1]
  else:
    memo[i] = (memo[i-1] + memo[i-2]) % MOD

if is_reach:
  print(memo[-1])
else:
  print(0)
