def calc(m)
  return @memo[m] if @memo.key?(m)
  return 1 if m < 2

  @memo[m] = calc(m-1) + calc(m-2)
  @memo[m]
end

MOD = 10**9 + 7
N, M = gets.chomp.split.map(&:to_i)
@memo = {}
x = []
start = 0
M.times do
  bs = gets.to_i
  finish = bs - 1
  if start == bs
    x << 0
    break
  else
    x << calc(finish - start)
  end
  start = bs + 1
end
x << calc(N - start)
ans = 1
x.each do |_x|
  ans = ans * _x % MOD
end
puts ans