#include "bits/stdc++.h"

// Begin {{{
using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (i64 i = 0; i < (n); ++i)
#define reps(i, b, e) for (i64 i = (b); i <= (e); ++i)
#define repr(i, b, e) for (i64 i = (b); i >= (e); --i)
#define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__)

#ifdef DEBUG
#define dump(...) dump_(#__VA_ARGS__, __VA_ARGS__);
#else
#define dump(...)
#endif

using i64 = int_fast64_t;
using pii = pair<i64, i64>;

template <class A, class B>
inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }

template <class A, class B>
inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

// input
void input() {}
template <class Head, class... Tail>
void input(Head&& head, Tail&&... tail) {
  cin >> head;
  input(forward<Tail>(tail)...);
}

// outs
void outs() {}
template <class Head, class... Tail>
void outs(Head&& head, Tail&&... tail) {
  cout << head << " \n"[sizeof...(tail)==0];
  outs(forward<Tail>(tail)...);
}

template <class T>
void outs(vector<T> &vec) { for (auto &e : vec) cout << e << " \n"[&e==&vec.back()]; }

template <class T>
void outs(vector<vector<T>> &df) { for (auto &vec : df) OUTS(vec); }

// outl
void outl() {}
template <class Head, class... Tail>
void outl(Head&& head, Tail&&... tail) {
  cout << head << "\n";
  outl(forward<Tail>(tail)...);
}

template <class T>
void outl(vector<T> &vec) { for (auto &e : vec) cout << e << "\n"; }

// outn
void outn() {}
template <class Head, class... Tail>
void outn(Head&& head, Tail&&... tail) {
  cout << head;
  outn(forward<Tail>(tail)...);
}

template <class T>
void outn(vector<T> &vec) { for (auto &e : vec) cout << e; }

// dump
template <class T>
void dump_(const char *s, T&& x) {
  clog << '{';
  while(*s != '\0') clog << *(s++);
  clog << ": " << x << '}' << "\n";
}

template <class Head, class... Tail>
void dump_(const char *s, Head&& head, Tail&&... tail) {
  clog << '{';
  while(*s != ',') clog << *(s++);
  clog << ": " << head << "}, ";
  for (++s; !isgraph(*s); ++s);
  dump_(s, forward<Tail>(tail)...);
}
// }}} End

// Mint {{{
template <i64 MOD>
class ModInt {
  i64 value;
public:
  inline ModInt(const ModInt& other) noexcept : value(other.value) {}
  inline ModInt(i64 value = 0) noexcept :
    value((value >= MOD) ? value % MOD : (value < 0) ? (value + MOD) % MOD : value) {}

  inline ModInt inv() const noexcept { return power(value, MOD - 2); }

  inline ModInt& operator+=(const ModInt& other) noexcept {
    value = (value + other.value) % MOD; return *this;
  }

  inline ModInt& operator-=(const ModInt& other) noexcept {
    value = (MOD + value - other.value) % MOD; return *this;
  }

  inline ModInt& operator*=(const ModInt& other) noexcept {
    value = (value * other.value) % MOD; return *this;
  }

  inline ModInt& operator/=(const ModInt& other) noexcept {
    value = (value * other.inv().value) % MOD; return *this;
  }

  inline ModInt operator+(const ModInt& other) noexcept { return ModInt(*this) += other; }
  inline ModInt operator-(const ModInt& other) noexcept { return ModInt(*this) -= other; }
  inline ModInt operator*(const ModInt& other) noexcept { return ModInt(*this) *= other; }
  inline ModInt operator/(const ModInt& other) noexcept { return ModInt(*this) /= other; }

  inline bool operator==(const ModInt& other) noexcept { return value == *other; }
  inline bool operator!=(const ModInt& other) noexcept { return value != *other; }

  template <class int_>
    explicit inline operator int_() const noexcept { return static_cast<int_>(value); }

  friend ostream& operator<<(ostream &os, ModInt other) noexcept {
    os << other.value; return os;
  }

  friend istream& operator>>(istream &is, ModInt& other) noexcept {
    is >> other.value; return is;
  }

  static constexpr inline ModInt power(i64 n, i64 p) noexcept {
    i64 ret = 1;
    for (; p > 0; p >>= 1) {
      if (p & 1) ret = (ret * n) % MOD;
      n = (n * n) % MOD;
    }
    return ret;
  }
};

using Mint = ModInt<MOD>;
// }}}

signed main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  var(int, N);

  map<i64, i64> cnt;
  rep(i, N) {
    var(int, a);
    cnt[a]++;
  }

  if (N % 2 && cnt[0] != 1) {
    outl(0); return 0;
  }

  for (int i = N - 1; i >= 1; i -= 2) {
    if (cnt[i] != 2) {
      outl(0); return 0;
    }
  }

  Mint res = Mint::power(2, N / 2);

  outl(res);

  return 0;
}


Measured memory_bytes: 4224