n, m = gets.split(" ").map(&:to_i)
brokens = []
brokens.push(0)
m.times do
  brokens.push(gets.to_i)
end
brokens.push(n)

brokens.reverse!

gaps = []

answer = 1

(brokens.length - 1).times do |index|
  if index == 0 || index == m
    gaps.push(brokens[index] - brokens[index + 1])
  else
    gaps.push(brokens[index] - brokens[index + 1] - 1)
    if brokens[index] - brokens[index + 1] - 1 == 0
      answer = 0
    end
  end
end

# puts gaps
# puts ""

sums = []
sums.push(0)
sums.push(1)
100001.times do |index|
  sums.push(sums[index] + sums[index + 1])
end
# puts sums

multipliers = []


gaps.each do |gap|
  multipliers.push(sums[gap])
end

# puts multipliers
# puts ""

# gaps.pop
# gaps.shift

# gaps.each do |gap|
#   if gap == 0
#     answer = 0
#   end
# end

multipliers.each do |multiplier|
  answer *= multiplier
  answer = answer % 1000000007
end

puts answer
