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

unless a.size < 2 || a[0..-2].zip(a[1..-1]).all? {|b, c| c - b > 1 }
  puts 0
  exit
end

@fibonatti = [1, 1]

def fibonatti(i)
  return @fibonatti[i] if @fibonatti[i]
  @fibonatti.size.step(i) do |k|
    @fibonatti[k] = @fibonatti[k - 1] + @fibonatti[k - 2]
  end
  @fibonatti[i]
end

ans = ([-1] + a).zip(a + [n+1]).inject(1) do |memo, (current, next_)|
  memo * fibonatti(next_ - current - 2)
end

puts (ans % 1_000_000_007)