import Data.List
import qualified Data.ByteString.Char8 as BS
main = do
  BS.getLine
  as <- sort . map (read . BS.unpack) . BS.words <$> BS.getLine :: IO [Int]
  if (odd $ length as) && (head as == 0) && (check 2 (tail as))
     then print $ solve (length as `div` 2)
  else if (even $ length as) && (check 1 as)
     then print $ solve (length as `div` 2)
  else 
     print 0

check :: Int -> [Int] -> Bool
check _ [] = True
check n (x:y:xs) 
  | x==n && y==n = check (n+2) xs
  | otherwise = False

solve :: Int -> Int
solve n = (2^n) `mod` (10^9+7)