n, m = map(int, input().split())
a = [int(input()) for i in range(m)]
if m > 1:
  for i in range(m-1):
    if a[i+1] == a[i] + 1:
      print(0)
      exit()
p = [0]*n
if a.count(1) == 0:
  p[0] = 1
else:
  p[0] = 0
if a.count(2) == 0:
  p[1] = 1 + p[0]
else:
  p[1] = 0
for i in range(2,n):
  if a.count(i+1) == 1:
    p[i] = 0
  else:
    p[i] = p[i-1] + p[i-2]
print(p[n-1] % 1000000007)