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 GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/STACK:2759095000")
using namespace std;
const long long MOD = 998244353;
const long long MOD1 = 7340033;
const long long BAS = 2500;
const long long dy[] = {1, -1, 0, 0};
const long long dx[] = {0, 0, 1, -1};
const long long INF = 1e9;
const double EPS = 1e-5;
const long double PI = 3.14159265358979323846;
const int SZ = 2000;
const long long MAXN = 2e6 + 10;
long long bp(long long w, long long st) {
  if (st == 0) return 1;
  if (st & 1) return w * bp(w, st - 1) % MOD;
  return bp(w * w % MOD, st >> 1);
}
const int LOG = 19, N = 1 << LOG;
int W = 2;
int perbit[N + 12];
long long wpow[N + 12];
void initFFt() {
  while (W++) {
    if (bp(W, N) == 1 && bp(W, N >> 1) != 1) break;
  }
  perbit[0] = 0;
  int k = 0;
  for (int i = 1; i < N; i++) {
    if (i == (1 << (k + 1))) k++;
    perbit[i] = perbit[i ^ (1 << k)] ^ (1 << (LOG - k - 1));
  }
  wpow[0] = 1;
  for (int i = 1; i < N; i++) wpow[i] = wpow[i - 1] * W % MOD;
}
long long F[2][N + 12];
long long sum(long long a, long long b) {
  if (a < 0) a += MOD;
  if (b < 0) b += MOD;
  if (a + b >= MOD) return a + b - MOD;
  return a + b;
}
void FFT(long long* A, int k) {
  int L = 1 << k;
  for (int mask = 0; mask < L; mask++)
    F[0][perbit[mask] >> (LOG - k)] = A[mask];
  int cur = 0, ncur = 1;
  for (int lvl = 0; lvl < k; lvl++) {
    int len = 1 << lvl;
    for (int st = 0; st < L; st += (len << 1)) {
      for (int i = 0; i < len; i++) {
        long long add =
            (F[cur][st + len + i] * wpow[i << (LOG - 1 - lvl)]) % MOD;
        F[ncur][st + i] = sum(F[cur][st + i], add);
        F[ncur][st + len + i] = sum(F[cur][st + i], MOD - add);
      }
    }
    swap(cur, ncur);
  }
  for (int i = 0; i < L; i++) A[i] = F[cur][i];
}
long long P[N + 12], Q[N + 12];
vector<long long> mulPoly(vector<long long> A, vector<long long> B) {
  int len = sum(A.size(), B.size()) + 1;
  int st = 0;
  while ((1 << st) < len) st++;
  len = 1 << st;
  for (int i = 0; i < A.size(); i++) P[i] = A[i];
  for (int i = 0; i < B.size(); i++) Q[i] = B[i];
  for (int i = A.size(); i < len; i++) P[i] = 0;
  for (int i = B.size(); i < len; i++) Q[i] = 0;
  FFT(P, st);
  FFT(Q, st);
  for (int i = 0; i < len; i++) P[i] = P[i] * Q[i] % MOD;
  FFT(P, st);
  reverse(P + 1, P + len);
  long long wq = bp(len, MOD - 2);
  for (int i = 0; i < len; i++) P[i] = P[i] * wq % MOD;
  A.resize(len);
  for (int i = 0; i < len; i++) A[i] = P[i];
  while (A.size() && A.back() == 0) A.pop_back();
  return A;
}
vector<long long> g[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(7);
  srand(89398);
  initFFt();
  map<int, int> cnt;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    cnt[x]++;
  }
  set<pair<long long, long long> > mn;
  int it = 0;
  for (auto p : cnt) {
    for (int i = 0; i <= p.second; i++) g[it].push_back(1);
    mn.insert({p.second + 1, it});
    it++;
  }
  while (mn.size() > 1) {
    pair<long long, long long> p = *mn.begin();
    mn.erase(p);
    pair<long long, long long> q = *mn.begin();
    mn.erase(q);
    g[q.second] = mulPoly(g[q.second], g[p.second]);
    mn.insert({g[q.second].size(), q.second});
  }
  pair<long long, long long> p = *mn.begin();
  cout << g[p.second][n / 2];
}
