local mod = 1000000007
local mfl = math.floor
local function bmul(x, y) return(x * y) % mod end

local function badd(x, y)
  return (x + y) % mod
end

local function bsub(x, y)
  return x < y and x - y + mod or x - y
end

local function modpow(src, pow)
  local res = 1
  while 0 < pow do
    if pow % 2 == 1 then
      res = bmul(res, src)
      pow = pow - 1
    end
    src = bmul(src, src)
    pow = mfl(pow / 2)
  end
  return res
end

local function modinv(src)
  return modpow(src, mod - 2)
end

local fact = {1}
local invs = {1}
local invfact = {1}
for i = 2, 100000 do
  fact[i] = bmul(fact[i - 1], i)
  invs[i] = bmul(mfl(mod / i), mod - invs[mod % i])
  invfact[i] = bmul(invfact[i - 1], invs[i])
end

local function getComb(n, k)
  if k == 0 or k == n then return 1 end
  return bmul(fact[n], bmul(invfact[k], invfact[n - k]))
end

local n = io.read("*n")
local t = {}
for i = 1, n + 1 do
  t[i] = io.read("*n")
end
local spos, epos = 0, 0
do
  local map = {}
  for i = 1, n + 1 do
    if not map[t[i]] then
      map[t[i]] = i
    else
      spos, epos = map[t[i]], i
      break
    end
  end
end
for k = 1, n + 1 do
  local use_zero = 0
  if k <= n - 1 then
    use_zero = getComb(n - 1, k)
  end
  local use_two = 0
  if 2 <= k then
    use_two = getComb(n - 1, k - 2)
  end
  local use_one = 0
  if k <= n then
    use_one = bmul(2, getComb(n - 1, k - 1))
  end
  local use_one_dup = 0
  local mid_range = epos - spos - 1
  if k - 1 <= n - 1 - mid_range then
    use_one_dup = getComb(n - 1 - mid_range, k - 1)
  end
  local ret = badd(use_zero, badd(use_two, bsub(use_one, use_one_dup)))
  print(ret)
end
