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;
using LL = long long;
using PII = pair<int, int>;
const int mod = 998244353;
const int root = 973800541;
const int root_1 = 595374802;
const int root_pw = 1 << 20;
int inverse(int a) {
  int res = 1;
  for (int n = mod - 2; n > 0; n >>= 1) {
    if (n & 1) res = (res * 1ll * a) % mod;
    a = (a * 1ll * a) % mod;
  }
  return res;
}
void ntt(vector<int>& a, bool invert = false) {
  int n = a.size();
  for (int i = 1, j = 0; i < n; i++) {
    int bit = n >> 1;
    for (; j & bit; bit >>= 1) j ^= bit;
    j ^= bit;
    if (i < j) swap(a[i], a[j]);
  }
  for (int len = 2; len <= n; len <<= 1) {
    int wlen = invert ? root_1 : root;
    for (int i = len; i < root_pw; i <<= 1)
      wlen = (int)(1LL * wlen * wlen % mod);
    for (int i = 0; i < n; i += len) {
      int w = 1;
      for (int j = 0; j < len / 2; j++) {
        int u = a[i + j], v = (int)(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 = (int)(1LL * w * wlen % mod);
      }
    }
  }
  if (invert) {
    int n_1 = inverse(n);
    for (int& x : a) x = (int)(1LL * x * n_1 % mod);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  map<int, int> fac;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    fac[a]++;
  }
  vector<vector<int>> polys(fac.size());
  priority_queue<PII, vector<PII>, greater<PII>> heap;
  {
    int idx = 0;
    for (auto& e : fac) {
      int nf = e.second;
      int sz = 1;
      while (sz <= nf) sz <<= 1;
      polys[idx].assign(sz, 0);
      for (int i = 0; i <= nf; i++) {
        polys[idx][i] = 1;
      }
      heap.emplace(sz, idx);
      idx++;
    }
  }
  while (heap.size() >= 2) {
    int i = heap.top().second;
    heap.pop();
    int j = heap.top().second;
    heap.pop();
    int sz = max(polys[i].size(), polys[j].size()) * 2;
    polys[i].resize(sz, 0);
    ntt(polys[i]);
    polys[j].resize(sz, 0);
    ntt(polys[j]);
    for (int k = 0; k < sz; k++) {
      polys[i][k] = (polys[i][k] * 1ll * polys[j][k]) % mod;
    }
    polys[j].clear();
    ntt(polys[i], true);
    heap.emplace(sz, i);
  }
  int i = heap.top().second;
  cout << polys[i][n / 2] << endl;
  return 0;
}
