local mce, mfl, msq, mmi, mma = math.ceil, math.floor, math.sqrt, math.min, math.max
local mab = math.abs
local mod = 1000000007
local n, m = io.read("*n", "*n")
local curpos = 0

local function bmul(x, y)
  local x0, y0 = x % 31623, y % 31623
  local x1, y1 = mfl(x / 31623), mfl(y / 31623)
  return (x1 * y1 * 14122 + (x1 * y0 + x0 * y1) * 31623 + x0 * y0) % mod
end

local function calcfibo(len)
  local a, b = 0, 1
  for i = 1, len do
    a, b = b, (a + b) % mod
  end
  return b
end

local ret = 1
for i = 1, m do
  local anapos = io.read("*n")
  if anapos == curpos then
    ret = 0
    curpos = n
  elseif curpos < anapos then
    local len = (anapos - 1) - curpos
    local fibo = calcfibo(len)
    ret = bmul(ret, fibo)
    curpos = anapos + 1
  end
end
if curpos < n then
  local len = n - curpos
  ret = bmul(ret, calcfibo(len))
end
print(ret)
