import Data.List
main = do
  getLine
  as <- map read . words <$> getLine :: IO [Int]
  print $ if check as then solve as else 0
  
check :: [Int] -> Bool
check xs
  | even $ length xs =
      all (even . length) (group $ sort xs)
  | otherwise =
      (length (filter (==0) xs) == 1) && (all (even . length) (group $ sort $ delete 0 xs))

solve :: [Int] -> Int
solve xs = 2 ^ (length xs `div` 2) `mod` (10^9+7)