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 int mod = 998244353, pr = 3;
long long int fst[400010], snd[400010], omg[400010], inv[400010];
int pos[400010], fstLen, sndLen, len, lim;
int arr[400010];
vector<int> polyns[400010];
long long int fastPow(long long int a, long long int n, long long int mod) {
  long long int ret = 1;
  a %= mod;
  while (n > 0) {
    if (n & 1) ret = (ret * a) % mod;
    a = (a * a) % mod;
    n >>= 1;
  }
  return ret;
}
void init() {
  len = 1, lim = 0;
  while (len < fstLen + sndLen - 1) len <<= 1, lim++;
  omg[0] = 1;
  inv[0] = 1;
  long long int w = fastPow(pr, (mod - 1) / len, mod);
  for (int i = 1; i < len; i++) {
    omg[i] = omg[i - 1] * w % mod;
    inv[len - i] = omg[i];
    pos[i] = (pos[i >> 1] >> 1) | ((i & 1) << (lim - 1));
  }
}
void ntt(long long int* arr, long long int* omg) {
  for (int i = 0; i < len; i++)
    if (i < pos[i]) swap(arr[i], arr[pos[i]]);
  for (int l = 2; l <= len; l <<= 1) {
    int midPt = l >> 1, step = len / l;
    for (long long int* p = arr; p != arr + len; p += l) {
      for (int i = 0, cnt = 0; i < midPt; i++, cnt += step) {
        long long int t = omg[cnt] * p[i + midPt] % mod;
        p[i + midPt] = (p[i] - t + mod) % mod;
        p[i] = (p[i] + t) % mod;
      }
    }
  }
}
void multiply() {
  init();
  int lenInv = fastPow(len, mod - 2, mod);
  ntt(fst, omg);
  ntt(snd, omg);
  for (int i = 0; i < len; i++) fst[i] = fst[i] * snd[i] % mod;
  ntt(fst, inv);
  for (int i = 0; i < fstLen + sndLen; i++) fst[i] = fst[i] * lenInv % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int len;
  cin >> len;
  for (int i = 0; i < len; i++) cin >> arr[i];
  sort(arr + 0, arr + len);
  vector<pair<int, int> > v;
  v.push_back(make_pair(arr[0], 1));
  for (int i = 1; i < len; i++) {
    if (arr[i] == v.back().first) {
      v.back().second++;
    } else {
      v.push_back(make_pair(arr[i], 1));
    }
  }
  priority_queue<pair<int, int>, vector<pair<int, int> >,
                 greater<pair<int, int> > >
      pq;
  int siz = v.size();
  for (int i = 0; i < siz; i++) {
    for (int j = 0; j <= min(len >> 1, v[i].second); j++)
      polyns[i].push_back(1);
    pq.push(make_pair(polyns[i].size(), i));
  }
  while (pq.size() > 1) {
    auto fstp = pq.top();
    pq.pop();
    auto sndp = pq.top();
    pq.pop();
    fstLen = fstp.first, sndLen = sndp.first;
    for (int i = 0; i < fstLen; i++) fst[i] = polyns[fstp.second][i];
    for (int i = 0; i < sndLen; i++) snd[i] = polyns[sndp.second][i];
    multiply();
    polyns[fstp.second].clear();
    for (int i = 0; i <= min(len >> 1, fstLen + sndLen - 2); i++)
      polyns[fstp.second].push_back(fst[i]);
    fill(fst + 0, fst + fstLen + sndLen - 1, 0);
    fill(snd + 0, snd + fstLen + sndLen - 1, 0);
    pq.push(make_pair((int)polyns[fstp.second].size(), fstp.second));
  }
  cout << polyns[pq.top().second][len >> 1] << '\n';
  return 0;
}
