use std::io::Write;

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn main() {
    let n: usize = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        let s = s.trim_right().to_owned();
        s.parse().unwrap()
    };

    let v: Vec<usize> = {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        let s = s.trim_right().to_owned();
        s.split_whitespace().map(|x| x.parse().unwrap()).collect()
    };

    let ans =
    if is_valid(v) {
        modulo::Modulo::new(2).pow(n / 2).0
    } else {
        0
    };
    println!("{}", ans);
}

fn is_valid(v: Vec<usize>) -> bool {
    let n = v.len();
    let mut count = vec![0; n + 1];
    for x in &v {
        count[*x] += 1;
    }

    let mut expect = vec![0; n + 1];
    if n % 2 == 0 {
        let mut i = 1;
        while i <= n {
            expect[i] = 2;
            i += 2;
        }
    } else {
        expect[0] = 1;

        let mut i = 2;
        while i <= n {
            expect[i] = 2;
            i += 2;
        }
    }

    count == expect
}

mod modulo {
    use std::ops::{Add, Mul, Sub};

    fn positive_rem(a: isize, b: usize) -> usize {
        let b = b as isize;
        let mut value = a % b;
        if value < 0 {
            value += b;
        }
        // TODO: TryFrom
        value as usize
    }

    /// Return (x, y) s.t. ax + by = d where d = gcd(a, b)
    fn ext_gcd(a: usize, b: usize) -> (isize, isize) {
        if b == 0 {
            return (1, 0);
        }

        let q = (a / b) as isize;
        let r = a % b;
        let (x1, y1) = ext_gcd(b, r);
        (y1, x1 - q * y1)
    }

    #[derive(Debug, Copy, Clone)]
    pub struct Modulo(pub usize);

    const MODULO: usize = 1_000_000_007;

    impl Modulo {
        pub fn new(n: usize) -> Modulo {
            // TODO: use TryFrom
            Modulo(n % MODULO)
        }

        pub fn from_isize(n: isize) -> Modulo {
            // TODO: use TryFrom
            Modulo(positive_rem(n, MODULO as usize))
        }

        pub fn pow(self, p: usize) -> Modulo {
            if self == Modulo(0) {
                return Modulo(0);
            }
            if p == 0 {
                return Modulo(1);
            }

            if p % 2 == 0 {
                let half = self.pow(p / 2);
                half * half
            } else {
                self.pow(p - 1) * self
            }
        }

        // when MODULO is prime
        pub fn inv(self) -> Modulo {
            let (x, _) = ext_gcd(self.0 as usize, MODULO as usize);
            Modulo::from_isize(x)
        }

        // when MODULO is prime
        pub fn binom_coef(n: isize, k: isize) -> Modulo {
            let mut ret = Modulo::from_isize(1);
            for i in 1..(k + 1) {
                ret = ret * Modulo::from_isize(n - i + 1) * Modulo::from_isize(i).inv();
            }
            ret
        }
    }

    impl Add for Modulo {
        type Output = Modulo;

        fn add(self, other: Modulo) -> Modulo {
            Modulo((self.0 + other.0) % MODULO)
        }
    }

    impl Sub for Modulo {
        type Output = Modulo;

        fn sub(self, other: Modulo) -> Modulo {
            Modulo(positive_rem(
                self.0 as isize - other.0 as isize,
                MODULO as usize,
            ))
        }
    }

    impl Mul for Modulo {
        type Output = Modulo;

        fn mul(self, other: Modulo) -> Modulo {
            Modulo((self.0 * other.0) % MODULO)
        }
    }

    impl PartialEq for Modulo {
        fn eq(&self, &other: &Self) -> bool {
            self.0 == other.0
        }
    }

    impl Eq for Modulo {}
}


Measured memory_bytes: 6396