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;
const double PI = atan2(0, -1);
long long rev(long long x, long long k) {
  long long res = 0;
  for (long long i = (0); i < (k); ++i) res |= ((x >> i) & 1) << (k - i - 1);
  return res;
}
void fft(vector<complex<double>> &a, bool invert) {
  long long n = (long long)(a.size());
  long long lg = __builtin_ctz(n);
  for (long long i = (0); i < (n); ++i) {
    long long j = rev(i, lg);
    if (j < i) swap(a[i], a[j]);
  }
  for (long long l = 1; l < n; l <<= 1) {
    double ang = PI / l * (invert ? -1 : 1);
    complex<double> x(cos(ang), sin(ang));
    for (long long i = 0; i < n; i += 2 * l) {
      complex<double> w(1);
      for (long long j = 0; j < l; j++) {
        complex<double> a0 = a[i + j], a1 = a[i + j + l];
        a[i + j] = a0 + w * a1;
        a[i + j + l] = a0 - w * a1;
        w *= x;
      }
    }
  }
  if (invert)
    for (long long i = (0); i < (n); ++i) a[i] /= (double)n;
}
void multiply(vector<long long> &a, vector<long long> &b) {
  vector<complex<double>> fa((a).begin(), (a).end()),
      fb((b).begin(), (b).end());
  long long n = 2;
  while (n < max((long long)(a.size()), (long long)(b.size()))) n <<= 1;
  n <<= 1;
  fa.resize(n), fb.resize(n), a.resize(n);
  fft(fa, false);
  fft(fb, false);
  for (long long i = (0); i < (n); ++i) fa[i] *= fb[i];
  fft(fa, true);
  for (long long i = (0); i < (n); ++i)
    a[i] = (((long long)(fa[i].real() + 0.5))) % 998244353;
}
void solve() {
  long long n;
  cin >> n;
  map<long long, long long> mp;
  for (long long i = (0); i < (n); ++i) {
    long long x;
    cin >> x;
    mp[x]++;
  }
  set<pair<long long, long long>> st;
  vector<vector<long long>> smt((long long)(mp.size()), vector<long long>());
  long long i = 0;
  for (auto [x, y] : mp) {
    smt[i].assign(y + 1, 1);
    st.insert({y, i});
    i++;
  }
  while (st.size() > 1) {
    long long fi = (*st.begin()).second;
    st.erase(st.begin());
    long long si = (*st.begin()).second;
    st.erase(st.begin());
    swap(fi, si);
    multiply(smt[fi], smt[si]);
    st.insert({(long long)(smt[fi].size()), fi});
  }
  long long fi = (*st.begin()).second, ans = 0;
  if (smt[fi].size() <= n / 2)
    ans = 0;
  else
    ans = smt[fi][n / 2];
  cout << ans << "\n";
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
