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 iinf = 0x3f3f3f3f;
const long long linf = 0x3f3f3f3f3f3f3f3f;
using poly = vector<int>;
const int mod = 998244353;
int Pow(int a, int first) {
  int res = 1;
  for (; first; a = 1ll * a * a % mod, first >>= 1)
    if (first & 1) res = 1ll * res * a % mod;
  return res;
}
const int G = 3, iG = Pow(G, mod - 2);
vector<int> rev;
void NTT(poly& a, int t) {
  int n = int((a).size());
  for (int i = (0), I = (n); i < I; i++)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int mid = 1; mid < n; mid <<= 1) {
    int wn = Pow(~t ? G : iG, (mod - 1) / (mid << 1));
    for (int i = 0; i < n; i += (mid << 1)) {
      int w = 1;
      for (int k = (i), I = (mid + i); k < I; k++) {
        int first = a[k], second = 1ll * w * a[mid + k] % mod;
        a[k] = (first + second) % mod,
        a[mid + k] = (first - second + mod) % mod;
        w = 1ll * w * wn % mod;
      }
    }
  }
  if (!~t) {
    int in = Pow(n, mod - 2);
    for (int i = (0), I = (n); i < I; i++) a[i] = 1ll * a[i] * in % mod;
  }
}
poly operator*(poly p, poly q) {
  int pn = int((p).size()), qn = int((q).size()),
      k = 1 << int(ceil(log2(pn + qn)));
  rev.assign(k, 0), p.resize(k, 0), q.resize(k, 0);
  for (int i = (0), I = (k); i < I; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) * (k >> 1));
  NTT(p, 1), NTT(q, 1);
  for (int i = (0), I = (k); i < I; i++) p[i] = 1ll * q[i] * p[i] % mod;
  NTT(p, -1), p.resize(pn + qn - 1);
  return p;
}
int n, cnt;
map<int, int> pcnt;
struct cmp {
  bool operator()(poly p, poly q) { return int((p).size()) > int((q).size()); }
};
priority_queue<poly, vector<poly>, cmp> que;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n, cnt = n / 2;
  for (int i = (0), I = (n); i < I; i++) {
    int p;
    cin >> p, pcnt[p]++;
  }
  for (auto u : pcnt) que.push(poly(u.second + 1, 1));
  while (int((que).size()) > 1) {
    poly p, q;
    p = que.top(), que.pop(), q = que.top(), que.pop();
    p = p * q;
    if (int((p).size()) > cnt + 1) p.resize(cnt + 1);
    que.push(p);
  }
  cout << (que.top())[cnt] << '\n';
  return 0;
}
