#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int n;
    std::cin >> n;
    int a[100000]={};
    long long int ans=1;
    for (int i = 0; i < n; i++) {
        int tmp;
        std::cin >> tmp;
        a[tmp]++;
    }
    a[0]++;
    for (int i = 1-n%2; i < n; i+=2) {
        if(a[i]!=2){
            std::cout << 0 << std::endl;
            return 0;
        }
    }
    int e=(n-n%2)/2;
    for (int i = 0; i < e; i++) {
        ans=ans*2%1000000007;
    }
    std::cout << ans << std::endl;
    return 0;
    
}
