n, m = gets.split.map(&:to_i)
a = m.times.map{ gets.to_i }

hoge = (0..n).to_a
a.map{ |i| hoge.delete(i) }

baz = 0
hoge.each_with_index do |var, index|
    break if index == hoge.length - 2
    if hoge[index+1] > var+2 then
        baz = 0
        break 
    end
    baz += 1 if var+1 == hoge[index+1] && var+2 == hoge[index+2]
end

puts (1..baz).to_a.inject(&:*) % (10**9 + 7)