n, m = map(int, input().split())
temp = [0] * (n + 1)
temp[0] = 0
temp[1] = 1
temp[2] = 2
for i in range(3, n + 1):
  temp[i] = temp[i-1] + temp[i-2]

mod = 10 ** 9 + 7
start = 0
cnt = 1
for i in range(m):
  ko = int(input())
  if ko == 1:
    start = ko + 1
    continue
  end = ko - 1
  diff = end - start
  if diff < 0:
    diff = 0
  if diff == 0:
    start = ko + 1
    continue
  cnt = cnt * temp[diff]
  start = ko + 1

if n - start != 0:
  cnt = cnt * temp[n - start]
print(cnt % mod)