N, M = gets.split(' ').map(&:to_i)
def fibonacci1(n)
    return 0 if n < 0
    return n if n < 3
    fibonacci1(n - 1) + fibonacci1(n - 2)
end
steps, start = 1, 0
M.times do |i|
  a = gets.to_i
  if a == start
    puts 0
    exit
  elsif a - 1 != start
    steps *= fibonacci1((a - 1) - start) % 1000000007
  end
  start = a + 1
  if i == M - 1 && a != N - 1
    steps *= fibonacci1(N - start) % 1000000007
  end
end
puts steps % 1000000007
