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>
const int MOD = 998244353;
const int N = 200005;
int n, s[3000005], L, rev[N * 4], A[N * 4], B[N * 4];
std::vector<int> wn1[25], wn2[25];
std::priority_queue<std::pair<int, int> > que;
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));
}
int ksm(int x, int y) {
  int ans = 1;
  while (y) {
    if (y & 1) ans = (long long)ans * x % MOD;
    x = (long long)x * x % MOD;
    y >>= 1;
  }
  return ans;
}
void init() {
  for (int i = 0; i < 20; i++) {
    int w1 = ksm(3, (MOD - 1) / (1 << (i + 1))),
        w2 = ksm(3, MOD - 1 - (MOD - 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 % MOD),
          wn2[i].push_back((long long)wn2[i][j - 1] * w2 % MOD);
  }
}
void NTT(int *a, int f) {
  for (int i = 0; i < L; i++)
    if (i < rev[i]) std::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]) % MOD;
        a[j + k] = (u + v) % MOD;
        a[j + k + i] = (u + MOD - v) % MOD;
      }
  }
  if (f == -1)
    for (int i = 0, ny = ksm(L, MOD - 2); i < L; i++)
      a[i] = (long long)a[i] * ny % MOD;
}
struct poly {
  std::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] % MOD;
    NTT(A, -1);
    poly ans;
    for (int i = 0; i < n + m; i++) ans.c.push_back(A[i]);
    return ans;
  }
} p[N];
int main() {
  init();
  scanf("%d", &n);
  int mx = 0, tot = 0;
  for (int i = 1, x; i <= n; i++) scanf("%d", &x), s[x]++, mx = std::max(mx, x);
  for (int i = 2; i <= mx; i++)
    if (s[i]) {
      tot++;
      for (int j = 0; j <= s[i]; j++) p[tot].c.push_back(1);
      que.push(std::make_pair(-s[i] - 1, tot));
    }
  while (1) {
    int x = que.top().second;
    que.pop();
    if (que.empty()) {
      printf("%d\n", p[x].c[(n + 1) / 2]);
      return 0;
    }
    int y = que.top().second;
    que.pop();
    p[x] = p[x] * p[y];
    p[y].c.clear();
    que.push(std::make_pair(-p[x].c.size(), x));
  }
  return 0;
}
