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 int64_t MOD = 998244353;
const int64_t root = 565042129;
const int64_t root_1 = 950391366;
const int64_t root_pw = 1 << 20;
int64_t mpow(int64_t x, int64_t y, int64_t m) {
  if (y == 0) return 1;
  int64_t temp = mpow(x, y / 2, m);
  if (y & 1) {
    temp = temp * temp;
    temp %= m;
    return (temp * x) % m;
  }
  return (temp * temp) % m;
}
int64_t inverse(int64_t a, int64_t mod) { return mpow(a, mod - 2, mod); }
void fft(vector<int64_t> &a, bool invert) {
  int64_t n = a.size();
  for (int64_t i = 1, j = 0; i < n; i++) {
    int64_t bit = n >> 1;
    for (; j & bit; bit >>= 1) j ^= bit;
    j ^= bit;
    if (i < j) swap(a[i], a[j]);
  }
  for (int64_t len = 2; len <= n; len <<= 1) {
    int64_t wlen = invert ? root_1 : root;
    for (int64_t i = len; i < root_pw; i <<= 1)
      wlen = (int64_t)(1LL * wlen * wlen % MOD);
    for (int64_t i = 0; i < n; i += len) {
      int64_t w = 1;
      for (int64_t j = 0; j < len / 2; j++) {
        int64_t u = a[i + j], v = (int64_t)(1LL * a[i + j + len / 2] * w % MOD);
        a[i + j] = u + v < MOD ? u + v : u + v - MOD;
        a[i + j + len / 2] = u - v >= 0 ? u - v : u - v + MOD;
        w = (int64_t)(1LL * w * wlen % MOD);
      }
    }
  }
  if (invert) {
    int64_t n_1 = inverse(n, MOD);
    for (int64_t &x : a) x = (int64_t)(1LL * x * n_1 % MOD);
  }
}
vector<int64_t> PolyMult(vector<int64_t> &a, vector<int64_t> &b) {
  vector<int64_t> fa(a.begin(), a.end()), fb(b.begin(), b.end());
  int64_t n = 1;
  while (n < a.size() + b.size()) n <<= 1;
  fa.resize(n);
  fb.resize(n);
  fft(fa, false);
  fft(fb, false);
  for (int64_t i = 0; i < n; i++) fa[i] = (fa[i] * fb[i]) % MOD;
  fft(fa, true);
  int64_t rn = a.size() + b.size() - 1;
  vector<int64_t> result(rn);
  for (int64_t i = 0; i < rn; i++) result[i] = fa[i];
  return result;
}
vector<int64_t> PolyPow(vector<int64_t> a, int64_t b) {
  int64_t t = 1;
  int64_t n = a.size();
  int64_t mulsz = n * b + 1;
  while (t < mulsz) {
    t <<= 2;
  }
  a.resize(t);
  fft(a, false);
  for (int64_t i = 0; i < t; i++) {
    a[i] = mpow(a[i], b % (MOD - 1), MOD);
  }
  fft(a, true);
  return a;
}
vector<vector<int64_t>> lmao;
vector<int64_t> solve(int64_t l, int64_t r) {
  if (l == r) {
    return lmao[l];
  }
  int64_t mid = (l + r) / 2;
  vector<int64_t> v1 = solve(l, mid);
  vector<int64_t> v2 = solve(mid + 1, r);
  return PolyMult(v1, v2);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int64_t n;
  cin >> n;
  vector<int64_t> arr(3000000);
  int64_t x;
  for (int64_t i = 0; i < n; i++) {
    cin >> x;
    arr[x]++;
  }
  vector<int64_t> cnt(n + 1);
  for (int64_t i = 0; i < 3000000; i++) {
    if (arr[i]) lmao.push_back(vector<int64_t>(arr[i] + 1, 1));
  }
  vector<int64_t> ans = solve(0, lmao.size() - 1);
  int64_t an2 = ans[n / 2];
  int64_t an1 = ans[(n + 1) / 2];
  cout << max(an1, an2);
  return 0;
}
