import Data.List
main=do
 n<-readLn;a<-map read.words<$>getLine
 print((if(even n)then (f 1 1) else (g 1 0))(sort a))
  where g i j a |a==[] = i
                |j==0&&(head a)==0 = g i (j+2) (tail a)
                |(head a)==j&&(head(tail a))==j = g (mod(i*2)1000000007) (j+2) (tail(tail a))
                |otherwise = 0
        f i j a |a==[] = i
                |(head a)==j&&(head(tail a))==j = g (mod(i*2)1000000007) (j+2) (tail(tail a))
                |otherwise = 0