import Data.List
import Data.Function (on)
import Control.Applicative

main = do
  n <- readLn :: IO Int
  xs <- group . sort . map read . words <$> getLine :: IO [[Int]]
  print $ solve xs n
  where
    solve :: [[Int]] -> Int -> Int
    solve [[x]] 1 | x == 0 = 1
                | otherwise = 0
    solve xs n | length [x | x <- xs, length x /= 2 && head x /= 0] > 0 = 0
               | otherwise = pow 2 (div n 2)
    pow x 1 = x
    pow x n = x * (pow x (n - 1)) `mod` 1000000007

