#include <iostream>

using namespace std;

int main() {
	int ans = 1;
	int a;
	cin >> a;
	int b[a];
	for (int i = 0;i < a;i++) {
		cin >> b[i];
	}
	int c[a / 2];
	for (int i = 0;i < (a / 2);i++) {
		c[i] = 0;
	}
	for (int i = 0;i < a;i++) {
		if (b[i] != 0) {
			c[(b[i] - 1) / 2] = c[(b[i] - 1) / 2] + 1;
		}
	}
	for (int i = 0;i < (a / 2);i++) {
		if (c[i] == 2) {
			ans = ans * 2 % 1000000007;
		}
		else {
			ans = 0;
			break;
		}
	}
	cout << ans << endl;
}