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;
int tr[2000005 << 2];
struct Pol {
  int l, op[2000005 << 2] = {0};
} a, b;
int qPow(int a, int b) {
  int ans = 1, x = a;
  while (b) {
    if (b & 1) ans = 1ll * ans * x % 998244353;
    x = 1ll * x * x % 998244353, b >>= 1;
  }
  return ans;
}
inline void NTT(int l, int *c, int type) {
  for (int i = 0; i < l; i++)
    if (i < tr[i]) swap(c[i], c[tr[i]]);
  for (int mid = 1; mid < l; mid <<= 1) {
    int wn = qPow(3, (998244353 - 1) / (mid << 1));
    if (type == -1) wn = qPow(wn, 998244353 - 2);
    for (int len = mid << 1, j = 0; j < l; j += len) {
      int w = 1;
      for (int k = 0; k < mid; k++, w = 1ll * w * wn % 998244353) {
        int x = c[j + k], y = 1ll * w * c[j + mid + k] % 998244353;
        c[j + k] = (1ll * x + y) % 998244353,
              c[j + mid + k] = (1ll * x - y) % 998244353;
      }
    }
  }
}
inline void multiple(Pol *ans, Pol *a, Pol *b) {
  int l = 1, le = 0;
  while (l <= a->l + b->l) l <<= 1, ++le;
  for (int i = 0; i < l; i++) {
    tr[i] = (tr[i >> 1] >> 1) | ((i & 1) << (le - 1));
    if (i > a->l) a->op[i] = 0;
    if (i > b->l) b->op[i] = 0;
  }
  NTT(l, a->op, 1), NTT(l, b->op, 1);
  for (int i = 0; i < l; i++) a->op[i] = 1ll * a->op[i] * b->op[i] % 998244353;
  NTT(l, a->op, -1), l = qPow(l, 998244353 - 2), ans->l = a->l + b->l;
  for (int i = 0; i <= ans->l; i++) ans->op[i] = 1ll * a->op[i] * l % 998244353;
}
vector<int> vvp;
map<int, int> mmp;
int n;
vector<int> solve(int l, int r) {
  if (l == r) {
    vector<int> s;
    for (int i = 0; i <= vvp[l]; i++) s.push_back(1);
    return s;
  }
  int mid = (l + r) >> 1;
  vector<int> aa = solve(l, mid), bb = solve(mid + 1, r);
  for (int i = 0; i < aa.size(); i++) a.op[i] = aa[i];
  for (int i = 0; i < bb.size(); i++) b.op[i] = bb[i];
  a.l = aa.size() - 1, b.l = bb.size() - 1;
  multiple(&a, &a, &b);
  vector<int> ans;
  for (int i = 0; i <= a.l && i <= (n >> 1); i++) ans.push_back(a.op[i]);
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1, x; i <= n; i++) scanf("%d", &x), ++mmp[x];
  for (pair<int, int> s : mmp) vvp.push_back(s.second);
  vector<int> a = solve(0, vvp.size() - 1);
  printf("%d", (a[n >> 1] + 998244353) % 998244353);
  return 0;
}
