
extension String: CollectionType {
    static func getValues(separator: Character = " ") -> [String] {
        return readLine()!.split(separator)
    }
}

func solve() {
        
    let mod = 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 * 10 + 7
    let N = UInt64(String.getValues()[0])!
    let As = String.getValues().map { UInt64($0)! }.sort()

    if N % 2 == 0 {
        for i in 0 ..< N / 2 - 1 {
            let filtered = As.filter({ A in
                A == 2 * i + 1
            })
            if filtered.count != 2 {
                print(0)
                return
            }
        }
        let result = (1 ... N / 2).reduce(1, combine: { current, i in
            (current % mod) * 2
        })
        print(result)
    } else {
        let zero = As.filter({ i in
            i == 0
        })
        if zero.count != 1 {
            print(0)
            return
        }
        
        for i in 1 ..< (N - 1) / 2 {
            let filtered = As.filter({ A in
                A == 2 * i
            })
            if filtered.count != 2 {
                print(0)
                return
            }
        }
        
        let result = (1 ... N / 2).reduce(1, combine: { current, i in
            (current % mod) * 2
        })
        print(result)
    }
}

solve()
