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 namespace std::chrono;
long long expo(long long base, long long exponent, long long mod) {
  long long ans = 1;
  while (exponent != 0) {
    if (exponent & 1) ans = (1LL * ans * base) % mod;
    base = (1LL * base * base) % mod;
    exponent >>= 1;
  }
  return ans % mod;
}
const long long mod = 998244353;
const long long root = 363395222;
const long long root_1 = 704923114;
const long long root_pw = 1 << 19;
void fft(vector<long long> &a, bool invert) {
  long long i, j, n = (long long)a.size();
  for (i = 1, j = 0; i < n; ++i) {
    long long bit = n >> 1;
    for (; j >= bit; bit >>= 1) {
      j -= bit;
    }
    j += bit;
    if (i < j) swap(a[i], a[j]);
  }
  for (long long len = 2; len <= n; len <<= 1) {
    long long wlen = invert ? root_1 : root;
    for (i = len; i < root_pw; i <<= 1) {
      wlen = (wlen * wlen % 998244353);
    }
    for (i = 0; i < n; i += len) {
      long long w = 1;
      for (j = 0; j < len / 2; ++j) {
        long long u = a[i + j],
                  v = (long long)(a[i + j + len / 2] * w % 998244353);
        a[i + j] = (u + v + 998244353) % 998244353;
        a[i + j + len / 2] = (u - v + 998244353) % 998244353;
        w = (w * wlen % 998244353);
      }
    }
  }
  if (invert) {
    long long nrev = expo(n, 998244353 - 2, 998244353);
    for (i = 0; i < n; ++i) {
      a[i] = (a[i] * nrev % 998244353);
    }
  }
}
void mul(const vector<long long> &a, const vector<long long> &b,
         vector<long long> &res) {
  vector<long long> fa(a.begin(), a.end()), fb(b.begin(), b.end());
  size_t n = 1;
  while (n < max(a.size(), b.size())) n <<= 1;
  n <<= 1;
  fa.resize(n), fb.resize(n);
  fft(fa, false), fft(fb, false);
  for (size_t i = 0; i < n; ++i) {
    fa[i] = (fa[i] * fb[i]) % 998244353;
  }
  fft(fa, true);
  res.resize(n);
  for (size_t i = 0; i < n; ++i) {
    res[i] = fa[i];
  }
}
vector<long long> v, pol[200005];
long long n, m, freq[3000005];
signed main() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> m;
    v.push_back(m);
    freq[m]++;
  }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  priority_queue<pair<long long, long long>, vector<pair<long long, long long>>,
                 greater<pair<long long, long long>>>
      q;
  for (long long i = 0; i < v.size(); i++) {
    pol[i].resize(freq[v[i]] + 1);
    for (long long j = 0; j < freq[v[i]] + 1; j++) {
      pol[i][j] = 1;
    }
  }
  for (long long i = 0; i < v.size(); i++) {
    q.push({pol[i].size(), i});
  }
  while ((long long)q.size() != 1) {
    pair<long long, long long> x = q.top();
    q.pop();
    pair<long long, long long> y = q.top();
    q.pop();
    mul(pol[x.second], pol[y.second], pol[x.second]);
    for (long long i = 0; i < pol[x.second].size(); i++) {
    }
    pol[y.second].clear();
    pol[x.second].resize(min((long long)pol[x.second].size(), n + 1));
    q.push({pol[x.second].size(), x.second});
  }
  cout << pol[q.top().second][n / 2] << '\n';
}
