import Data.List
import qualified Data.ByteString.Char8 as B
import Data.Maybe

main = do
  n <- readLn
  as <- sort . map (fst . fromJust . B.readInteger) . B.words <$> B.getLine
  print (liningUp n as)

liningUp n as
  | odd n && as == lodd = 2 ^ (div n 2) `mod` (10^9+7)
  | even n && as == leven = 2 ^ (div n 2) `mod` (10^9+7)
  | otherwise = 0
  where
    lodd  = take n $ concat $ transpose [[0,2..],[2,4..]]
    leven = take n $ concat $ transpose [[1,3..],[1,3..]]