import std.stdio, std.algorithm, std.conv, std.array, std.string;

long N = 10^^9 + 7;

void main()
{
    auto n = readln.chomp.to!int;
    auto as = readln.split.to!(long[]).sort();

    if (n&1) as = as[1..$];

    for (size_t i = 0; i < n-1; ++i) {
        if (as[i] != as[++i]) {
            writeln("0");
            return;
        }
    }

    n = n / 2 - 1;
    long ret = 2;
    for (; n; --n) ret = ret*2 % N;
    assert(ret);
    writeln(ret);
}