def combi(n,k)
  r = 1
  (1..k).each{|i| r *= n; n -= 1; r /= i }
  r
end

def count_interval(x,y)
  max_k = (y-x)/2
  count = 0
  (0..max_k).each { |k|
    count += combi(y-x-k,k)
    }
  count
end

n,m=gets.chomp.split().map(&:to_i)
a=[]
m.times{a.push(gets.chomp.to_i)}
total = count_interval(0,a[0]-1)
(0..(m-2)).each do |l|
  if a[l]+1 == a[l+1] then
    total = 0
    break
  end
  total *= count_interval(a[l]+1,a[l+1]-1)
  total %= 1_000_000_007 
end
  
unless total == 0
  total *= count_interval(a[m-1]+1,n)
  total %= 1_000_000_007 
end
puts total

