lines = []
while line = gets
    lines << line.chomp.split(' ').map(&:to_i)
end

N = lines[0][0]
M = lines[0][1]
Mod = 10 ** 9 + 7

danger = []
for i in 1..N do
  danger.push(false)
end
for i in 1..M do
  danger[lines[i][0]-1] = true
end

ways = []
for i in 1..N do
  if danger[i-1] then
    ways[i-1] = 0
  elsif i == 1 then
    ways[i-1] = 1
  elsif i == 2 then
    ways[i-1] = ways[i-2] + 1
  else
    ways[i-1] = ways[i-2] + ways[i-3]
  end
end
    
print ways[N-1] % Mod