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")
using namespace std;
const int N = 6000050;
const long long mod = 998244353;
long long curr[N], tmp[N];
long long KSM(long long a, long long b) {
  long long t = 1;
  while (b) {
    if (b & 1) t = (t * a) % mod;
    b >>= 1;
    a = (a * a) % mod;
  }
  return t;
}
void NTT(int n, long long a[], int opt) {
  int i, j = 0, k;
  for (i = 0; i < n; i++) {
    if (i > j) swap(a[i], a[j]);
    for (int l = n >> 1; (j ^= l) < l; l >>= 1)
      ;
  }
  for (i = 1; i < n; i <<= 1) {
    long long wn = KSM(3, (mod - 1) / (i << 1));
    int m = i << 1;
    for (j = 0; j < n; j += m) {
      long long w = 1;
      for (k = 0; k < i; k++, w = (w * wn) % mod) {
        long long z = (a[j + i + k] * w) % mod;
        a[i + j + k] = (a[j + k] - z + mod) % mod;
        a[j + k] = (a[j + k] + z) % mod;
      }
    }
  }
  if (opt == -1) reverse(a + 1, a + n);
}
void NTTmult(long long a[], long long b[], int dega, int degb) {
  int fn = 1;
  while (fn <= dega + degb) fn <<= 1;
  NTT(fn, a, 1);
  NTT(fn, b, 1);
  for (int i = 0; i <= fn; i++) a[i] = (a[i] * b[i]) % mod;
  NTT(fn, a, -1);
  long long t = KSM(fn, mod - 2);
  for (int i = 0; i < fn; i++) a[i] = (a[i] * t) % mod;
}
int n, m;
long long cnt[3000100];
priority_queue<pair<int, vector<long long>>,
               vector<pair<int, vector<long long>>>,
               greater<pair<int, vector<long long>>>>
    pq;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < int(n); i++) {
    int x;
    cin >> x;
    cnt[x]++;
  }
  m = n / 2;
  for (int i = 0; i < int(3000000); i++) {
    if (cnt[i] > 0) {
      vector<long long> v;
      for (int j = 0; j < int(cnt[i] + 1); j++) v.push_back(1);
      pq.push(make_pair(cnt[i], v));
    }
  }
  while (pq.size() > 1) {
    int dega = pq.top().first;
    vector<long long> va = pq.top().second;
    pq.pop();
    int degb = pq.top().first;
    vector<long long> vb = pq.top().second;
    pq.pop();
    int fn = 1;
    while (fn <= dega + degb) fn <<= 1;
    for (int i = 0; i < int(fn + 10); i++) curr[i] = tmp[i] = 0;
    for (int i = 0; i < int(dega + 1); i++) curr[i] = va[i];
    for (int i = 0; i < int(degb + 1); i++) tmp[i] = vb[i];
    NTTmult(curr, tmp, dega, degb);
    int degc = dega + degb;
    vector<long long> vc;
    for (int i = 0; i < int(degc + 1); i++) vc.push_back(curr[i]);
    pq.push(make_pair(degc, vc));
  }
  vector<long long> ans = pq.top().second;
  cout << ans[m] << endl;
}
