import Data.List( sort, group)
main = do
    n_ <- readLn
    reports_ <- return . map read . words =<< getLine
    let chkOdd list = all odd list
	chkEven list = all even list
	twoList [_,_]	= True
	twoList _	= False
	check r
	  | even n_ = if chkOdd r
		    then let l = group.sort$r
			 in if all twoList l then (2::Integer)^(length l)
						    else 0
		    else 0
	  | otherwise = if chkEven r
		      then let zero:rem = group.sort$r
			   in if zero==[0]  then (2::Integer)^(length rem)
					    else 0
		      else 0
    print $ (check reports_) `mod` (10^9 + 7)