You are given an integer x represented as a product of n its prime divisors p_1 ⋅ p_2, ⋅ … ⋅ p_n. Let S be the set of all positive integer divisors of x (including 1 and x itself).

We call a set of integers D good if (and only if) there is no pair a ∈ D, b ∈ D such that a ≠ b and a divides b.

Find a good subset of S with maximum possible size. Since the answer can be large, print the size of the subset modulo 998244353.

Input

The first line contains the single integer n (1 ≤ n ≤ 2 ⋅ 10^5) — the number of prime divisors in representation of x.

The second line contains n integers p_1, p_2, ..., p_n (2 ≤ p_i ≤ 3 ⋅ 10^6) — the prime factorization of x.

Output

Print the maximum possible size of a good subset modulo 998244353.

Examples

Input


3
2999999 43 2999957


Output


3


Input


6
2 3 2 3 2 2


Output


3

Note

In the first sample, x = 2999999 ⋅ 43 ⋅ 2999957 and one of the maximum good subsets is \{ 43, 2999957, 2999999 \}.

In the second sample, x = 2 ⋅ 3 ⋅ 2 ⋅ 3 ⋅ 2 ⋅ 2 = 144 and one of the maximum good subsets is \{ 9, 12, 16 \}.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <long long mod>
struct modular {
  long long value;
  modular(long long x = 0) {
    value = x % mod;
    if (value < 0) value += mod;
  }
  modular& operator+=(modular other) {
    if ((value += other.value) >= mod) value -= mod;
    return *this;
  }
  modular& operator-=(modular other) {
    if ((value -= other.value) < 0) value += mod;
    return *this;
  }
  modular& operator*=(modular other) {
    value = value * other.value % mod;
    return *this;
  }
  modular& operator/=(modular other) {
    long long a = 0, b = 1, c = other.value, m = mod;
    while (c != 0) {
      long long t = m / c;
      m -= t * c;
      swap(c, m);
      a -= t * b;
      swap(a, b);
    }
    a %= mod;
    if (a < 0) a += mod;
    value = value * a % mod;
    return *this;
  }
  modular operator-() { return modular(-value); }
  modular operator+(modular rhs) { return modular(*this) += rhs; }
  modular operator-(modular rhs) { return modular(*this) -= rhs; }
  modular operator*(modular rhs) { return modular(*this) *= rhs; }
  modular operator/(modular rhs) { return modular(*this) /= rhs; }
  bool operator==(modular rhs) { return value == rhs.value; }
  bool operator!=(modular rhs) { return value != rhs.value; }
  bool operator<(modular rhs) { return value < rhs.value; }
};
template <long long mod>
string to_string(modular<mod> x) {
  return to_string(x.value);
}
template <long long mod>
ostream& operator<<(ostream& stream, modular<mod> x) {
  x.value %= mod;
  if (x.value < 0) x.value += mod;
  return stream << x.value;
}
template <long long mod>
istream& operator>>(istream& stream, modular<mod>& x) {
  stream >> x.value;
  x.value %= mod;
  if (x.value < 0) x.value += mod;
  return stream;
};
const long long mod = 998244353LL;
using mint = modular<mod>;
inline mint pw(mint a, long long n) {
  mint res = 1;
  while (n > 0) {
    if (n & 1) {
      res *= a;
    }
    a *= a;
    n >>= 1;
  }
  return res;
}
vector<mint> fact, finv;
inline void cinit(int n) {
  fact.resize(n, 1);
  finv.resize(n, 1);
  for (int i = 2; i < n; i++) {
    fact[i] = fact[i - 1] * i;
  }
  finv[n - 1] /= fact[n - 1];
  for (int i = n - 2; i >= 2; i--) {
    finv[i] = finv[i + 1] * (i + 1);
  }
}
inline mint C(int n, int k) {
  if (n < k || k < 0 || n < 0) return 0;
  return fact[n] * finv[k] * finv[n - k];
}
inline mint H(int n, int k) { return C(n + k - 1, k); }
struct cmp {
  bool operator()(const vector<mint>& a, const vector<mint>& b) {
    return a.size() < b.size();
  }
};
mint root;
int base;
int max_base;
vector<mint> roots;
vector<int> rev;
void ensure_base(int nbase) {
  if (roots.empty()) {
    auto tmp = mod - 1;
    max_base = 0;
    while (tmp % 2 == 0) {
      tmp /= 2;
      max_base++;
    }
    root = 2;
    while (pw(root, (mod - 1) >> 1) == 1) {
      root += 1;
    }
    root = pw(root, (mod - 1) >> max_base);
    base = 1;
    rev = {0, 1};
    roots = {0, 1};
  }
  if (nbase <= base) {
    return;
  }
  rev.resize(1 << nbase);
  for (int i = 0; i < (1 << nbase); i++) {
    rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (nbase - 1));
  }
  roots.resize(1 << nbase);
  while (base < nbase) {
    mint z = pw(root, 1 << (max_base - 1 - base));
    for (int i = 1 << (base - 1); i < (1 << base); i++) {
      roots[i << 1] = roots[i];
      roots[(i << 1) + 1] = roots[i] * z;
    }
    base++;
  }
}
void ntt(vector<mint>& a) {
  int n = (int)a.size();
  int zeros = __builtin_ctz(n);
  ensure_base(zeros);
  int shift = base - zeros;
  for (int i = 0; i < n; i++) {
    if (i < (rev[i] >> shift)) {
      swap(a[i], a[rev[i] >> shift]);
    }
  }
  for (int k = 1; k < n; k <<= 1) {
    for (int i = 0; i < n; i += 2 * k) {
      for (int j = 0; j < k; j++) {
        mint x = a[i + j];
        mint y = a[i + j + k] * roots[j + k];
        a[i + j] = x + y;
        a[i + j + k] = x - y;
      }
    }
  }
}
vector<mint> multiply(vector<mint> a, vector<mint> b) {
  int need = (int)a.size() + (int)b.size() - 1;
  int nbase = 0;
  while ((1 << nbase) < need) {
    nbase++;
  }
  ensure_base(nbase);
  int sz = 1 << nbase;
  a.resize(sz);
  b.resize(sz);
  ntt(a);
  ntt(b);
  mint inv = mint(1) / mint(sz);
  for (int i = 0; i < sz; i++) {
    a[i] *= b[i] * inv;
  }
  reverse(a.begin() + 1, a.end());
  ntt(a);
  a.resize(need);
  return a;
}
vector<mint>& operator*=(vector<mint>& a, const vector<mint>& b) {
  if (min(a.size(), b.size()) < 150) {
    vector<mint> c = a;
    a.assign(a.size() + b.size() - 1, 0);
    for (int i = 0; i < (int)c.size(); i++) {
      for (int j = 0; j < (int)b.size(); j++) {
        a[i + j] += c[i] * b[j];
      }
    }
  } else {
    a = multiply(a, b);
  }
  return a;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    mp[p]++;
  }
  multiset<vector<mint>, cmp> ms;
  ms.emplace(vector<mint>(1, 1));
  for (auto e : mp) {
    ms.emplace(vector<mint>(e.second + 1, 1));
  }
  while (ms.size() != 1) {
    auto j = ms.begin();
    auto i = j++;
    ms.emplace(multiply(*i, *j));
    ms.erase(i);
    ms.erase(j);
  }
  vector<mint> res = *ms.begin();
  int z = res.size();
  cout << res[z / 2] << '\n';
  return 0;
}
