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 int MX = 200005, mod = 998244353, gen = 3;
long long pot(long long b, long long p) {
  long long res = 1;
  p = ((((p) % (mod - 1)) + (mod - 1)) % (mod - 1));
  while (p) {
    if (p & 1) (res *= b) %= mod;
    (b *= b) %= mod;
    p /= 2;
  }
  return res;
}
int npt(int n) {
  int res = 1;
  while (res < n) res <<= 1;
  return res;
}
void ntt(vector<int> &x, int inv) {
  int n = x.size();
  for (int i = 1, j = 0; i < n - 1; i++) {
    for (int k = n >> 1; (j ^= k) < k; k >>= 1)
      ;
    if (i < j) swap(x[i], x[j]);
  }
  vector<long long> wp(n >> 1, 1);
  for (int k = 1; k < n; k <<= 1) {
    long long wk = pot(gen, inv * (mod - 1) / (k << 1));
    for (int j = 1; j < k; j++) wp[j] = wp[j - 1] * wk % mod;
    for (int i = 0; i < n; i += k << 1) {
      for (int j = 0; j < k; j++) {
        int u = x[i + j], v = x[i + j + k] * wp[j] % mod;
        x[i + j] = u + v < mod ? u + v : u + v - mod;
        x[i + j + k] = u - v < 0 ? u - v + mod : u - v;
      }
    }
  }
  if (inv == -1) {
    long long nrev = pot(n, mod - 2);
    for (int i = 0; i < n; ++i) x[i] = x[i] * nrev % mod;
  }
}
int n;
map<int, int> mp;
vector<int> x[MX];
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>>
    pq;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  while (n--) {
    int p;
    cin >> p;
    mp[p]++;
  }
  int i = 0;
  for (auto it = mp.begin(); it != mp.end(); it++, i++) {
    x[i] = vector<int>(it->second + 1, 1);
    pq.emplace(it->second + 1, i);
  }
  while (pq.size() > 1) {
    pair<int, int> a = pq.top();
    pq.pop();
    pair<int, int> b = pq.top();
    pq.pop();
    n = npt(a.first + b.first - 1);
    x[a.second].resize(n);
    ntt(x[a.second], 1);
    x[b.second].resize(n);
    ntt(x[b.second], 1);
    for (int i = 0; i < n; i++)
      x[a.second][i] = 1ll * x[a.second][i] * x[b.second][i] % mod;
    ntt(x[a.second], -1);
    x[a.second].resize(a.first + b.first - 1);
    x[b.second].clear();
    pq.emplace(a.first + b.first - 1, a.second);
  }
  int j = pq.top().second, res = 0;
  for (int y : x[j]) res = max(res, y);
  cout << res << '\n';
  return 0;
}
