import Data.List
import Data.List.Split
import System.Environment (getArgs)

takePairs ls | ((length ls) `rem` 2) == 1 = f (0:ls) 0
             | otherwise = f ls 1
  where f l@(x:y:xs) i | (x == i) && (y == i) = f xs (i + 2)
                       | otherwise = l
        f [] _ = []

solve ls = if (null $ takePairs $ sort ls) == True then (f ((length ls) `div` 2)) else 0
  where f 0 = 1
        f n = (2 * (f (n - 1))) `rem` 1000000007

main = do
  lx <- getLine
  ln <- getLine
  let ls = map (read::String->Int) $ splitOn " " ln
  putStrLn $ show $ solve ls
