import Control.Applicative
import Control.Monad
import Data.List

func xs =
  if odd (length xs) then
    and $ zipWith (==) xs (0:(map (\x -> if odd x then x+1 else x) [1..]))
  else
    and $ zipWith (==) xs ((map (\x -> if even x then x-1 else x) [1..]))

power 0 = 1
power n = (2 * (power (n-1))) `mod` (10^9+7)

main = do
  n <- (read::String->Int) <$> getLine
  as <- (map (read::String->Int)) . words <$> getLine
  
  print $
    if func (sort as) then
      power (n`div`2)
    else
      0
