N, M = gets.split.map(&:to_i)
a = []
M.times do |i|
  a << gets.to_i
  if a.size > 1
    if a[i] - a[i - 1] == 1
      p 0
      exit
    end
  end
end

dp = Array.new(N + 2, 0)
mod = 10 ** 9 + 7

dp[0] = 1
j = 0
N.times do |i|
  j += 1 if j < M && a[j] <= i
  unless j < M && a[j] == i + 1
    dp[i + 1] += dp[i]
    dp[i + 1] %= mod
  end
  unless j < M && a[j] == i + 2 || j + 1 < M && a[j + 1] == i + 2
    dp[i + 2] += dp[i]
    dp[i + 2] %= mod
  end
end

p dp[N]
