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>
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
using namespace std;
const int mo = 998244353;
const int maxn = 200005;
int L, rev[maxn * 4], A[maxn * 4], B[maxn * 4];
vector<int> wn1[30], wn2[30];
int qpow(int x, int y) {
  int ans = 1;
  while (y) {
    if (y & 1) ans = (long long)ans * x % mo;
    x = (long long)x * x % mo;
    y >>= 1;
  }
  return ans;
}
void pre(int n) {
  int lg = 0;
  for (L = 1; L <= n; L <<= 1, lg++)
    ;
  for (int i = 0; i < L; i++)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (lg - 1));
}
void init(int maxlen) {
  maxlen <<= 2;
  for (int i = 0; maxlen; i++, maxlen >>= 1) {
    int w1 = qpow(3, (mo - 1) / (1 << (i + 1))),
        w2 = qpow(3, mo - 1 - (mo - 1) / (1 << (i + 1)));
    wn1[i].push_back(1);
    wn2[i].push_back(1);
    for (int j = 1; j < (1 << i); j++)
      wn1[i].push_back((long long)wn1[i][j - 1] * w1 % mo),
          wn2[i].push_back((long long)wn2[i][j - 1] * w2 % mo);
  }
}
void NTT(int *a, int f) {
  for (int i = 0; i < L; i++)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int i = 1, lg = 0; i < L; i <<= 1, lg++) {
    for (int j = 0; j < L; j += (i << 1))
      for (int k = 0; k < i; k++) {
        int u = a[j + k], v = (long long)a[j + k + i] *
                              (f == 1 ? wn1[lg][k] : wn2[lg][k]) % mo;
        a[j + k] = (u + v) % mo;
        a[j + k + i] = (u + mo - v) % mo;
      }
  }
  if (f == -1)
    for (int i = 0, ny = qpow(L, mo - 2); i < L; i++)
      a[i] = (long long)a[i] * ny % mo;
}
struct poly {
  vector<int> c;
  poly operator*(const poly &a) const {
    int n = c.size(), m = a.c.size();
    pre(n + m);
    for (int i = 0; i < L; i++) A[i] = B[i] = 0;
    for (int i = 0; i < n; i++) A[i] = c[i];
    for (int i = 0; i < m; i++) B[i] = a.c[i];
    NTT(A, 1);
    NTT(B, 1);
    for (int i = 0; i < L; i++) A[i] = (long long)A[i] * B[i] % mo;
    NTT(A, -1);
    poly ans;
    for (int i = 0; i < n + m; i++) ans.c.push_back(A[i]);
    return ans;
  }
} p[maxn];
const int maxv = 3e6 + 9;
int id[maxv], iid(0);
int cnt[maxn], n;
priority_queue<pair<int, int> > que;
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  init(n);
  for (int i = int(1); i <= int(n); ++i) {
    int val;
    cin >> val;
    if (!id[val]) id[val] = ++iid;
    cnt[id[val]]++;
  }
  for (int i = int(1); i <= int(iid); ++i) {
    for (int j = int(0); j <= int(cnt[i]); ++j) p[i].c.emplace_back(1);
    que.push({-cnt[i], i});
  }
  while (1) {
    int x = que.top().second;
    que.pop();
    if (que.empty()) {
      cout << p[x].c[(n + 1) / 2] << '\n';
      break;
    }
    int y = que.top().second;
    que.pop();
    p[x] = p[x] * p[y];
    p[y].c.clear();
    que.push({-p[x].c.size(), x});
  }
}
