import Control.Monad
import Data.List

--powmod a b p= (a ^ b) mod p
powmod a b p
    | odd b  = mod ((b *) $ powmod a (b-1) p) p
    | b == 2 = mod (a*a) p
    | True   = mod ((^ 2) $ powmod a (div b 2) p) p

main=do
    n<-readLn :: IO Int
    aa@(a:as) <-sort.map read.words<$>getLine :: IO [Int]
    print $ if (if even n then chk 1 aa else (a==0) && (chk 2 as))
        then powmod 2 (n`div`2) 1000000007
        else 0

chk _ [] = True
chk n (a:b:as)
    | a==n && b==n = chk (n+2) as
    | True = False
