n = io.read("*n")
t = {}
for i = 1, n do
  a = io.read("*n")
  if not t[a] then t[a] = 0 end
  t[a] = t[a] + 1
end
if n % 2 == 0 then
  hn = n // 2
  v = true
  for i = 1, hn do
    z = i * 2 - 1
    if t[z] ~= 2 then v = false break end
  end
  if v then
    r = 1
    for i = 1, hn do
      r = (r * 2) % 1000000007
    end
    print(r)
  else
    print(0)
  end
else
  v = t[0] == 1
  hn = n // 2
  r = 1
  for i = 2, n, 2 do
    if t[i] ~= 2 then v = false break end
    r = (r * 2) % 1000000007
  end
  if v then
    print(r)
  else
    print(0)
  end
end
