import Data.List

main :: IO ()
main = do
    n  <- read <$> getLine :: IO Int
    ns <- map (\l -> (head l, length l)) . group . sort . map read . words <$> getLine :: IO [(Int, Int)]
    let can = if odd n then f True ns             && all (even . fst) ns 
                       else ns == [(i, 2)|i <- take (length ns) [1,3..]]
    print $ if not can then 0
                       else if even n then 2 |^ div n 2
                                      else 2 |^ div (n-1) 2

f _ [] = True
f nonAlready ((n, l):ns) = 
    if l == 2 then f nonAlready ns 
              else nonAlready && l == 1 && n == 0 && f False ns

fact :: Int -> Int
fact 0 = 1
fact n = n |* fact (n|-1)

modN :: Int
modN = 10^9+7
 
(|+) :: Int -> Int -> Int
(|+) n m = (`mod` modN) $ n + m 

(|-) :: Int -> Int -> Int
(|-) n m = (`mod` modN) $ n - m 

(|*) :: Int -> Int -> Int
(|*) n m = (`mod` modN) $ (n `mod` modN) * (m `mod` modN) 

(|^) :: Int -> Int -> Int
(|^) x n
  | n == 0    = 1
  | even n    = mod (x*x) modN |^ div n 2
  | otherwise = (`mod` modN) $ (x |^ (n - 1)) * x

(|/) :: Int -> Int -> Int
(|/) n m = n |* (m |^ (modN - 2))
