MOD_SIZE = 1_000_000_007

N, M = gets.chomp.split(' ').map(&:to_i)
brokens = (M.times.map { gets.to_i }).uniq.sort
brokens.unshift(-1)
brokens.push(N+1)

$memo = {}
$memo[0] = 1
$memo[1] = 1
2.upto(N) do |i|
  $memo[i] = ($memo[i-2] + $memo[i-1]) % MOD_SIZE
end

def count_step_patterns(steps)
  return 1 if steps <= 1
  return $memo[steps] if $memo.key?(steps)
  $memo[steps] = count_step_patterns(steps-1) + count_step_patterns(steps-2)
end

cannot_reach = brokens.inject(nil) { |before, value|
  next value if before.nil?
  break nil if before + 1 == value
  value
}.nil?

if cannot_reach
  puts 0
else
  splitted = 0.upto(brokens.size-2).map { |i| brokens[i+1] - brokens[i] - 2 }
  puts splitted.inject(1) { |sum, steps| sum * $memo[steps] % MOD_SIZE }
end

