void main()
{
    long n = readln.chomp.to!long;
    long[] a = readln.split.to!(long[]);

    long mod = 10 ^^ 9 + 7;
    auto g = a.sort!"a < b".group.array;
    bool ok = true;
    foreach (i, x; g)
    {
        if (n & 1)
        {
            if (i == 0)
            {
                if (x[0] != 0 || x[1] != 1)
                {
                    ok = false;
                }
            }
            else
            {
                if (x[0] != 2 * i || x[1] != 2)
                {
                    ok = false;
                }
            }
        }
        else
        {
            if (x[0] != 2 * i + 1 || x[1] != 2)
            {
                ok = false;
            }
        }
    }

    long result;
    if (ok)
    {
        result = 1;
        foreach (i; 0 .. n/2)
        {
            result = result * 2 % mod;
        }
    }

    result.writeln;
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;