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;
long long power(long long a, long long p, long long mod) {
  if (p == 0) return 1;
  long long ans = power(a, p / 2, mod);
  ans = (ans * ans) % mod;
  if (p % 2) ans = (ans * a) % mod;
  return ans;
}
struct NTT {
  int N;
  vector<int> perm;
  int mod, root, inv, pw;
  NTT(int mod, int root, int inv, int pw)
      : mod(mod), root(root), inv(inv), pw(pw) {}
  void precalculate() {
    perm.resize(N);
    perm[0] = 0;
    for (int k = 1; k < N; k <<= 1) {
      for (int i = 0; i < k; i++) {
        perm[i] <<= 1;
        perm[i + k] = 1 + perm[i];
      }
    }
  }
  void fft(vector<long long> &v, bool invert = false) {
    if (v.size() != perm.size()) {
      N = v.size();
      assert(N && (N & (N - 1)) == 0);
      precalculate();
    }
    for (int i = 0; i < N; i++) {
      if (i < perm[i]) swap(v[i], v[perm[i]]);
    }
    for (int len = 2; len <= N; len <<= 1) {
      long long factor = invert ? inv : root;
      for (int i = len; i < pw; i <<= 1) factor = (factor * factor) % mod;
      for (int i = 0; i < N; i += len) {
        long long w = 1;
        for (int j = 0; j < len / 2; j++) {
          long long x = v[i + j], y = (w * v[i + j + len / 2]) % mod;
          v[i + j] = (x + y) % mod;
          v[i + j + len / 2] = (x + mod - y) % mod;
          w = (w * factor) % mod;
        }
      }
    }
    if (invert) {
      long long _n = power(N, mod - 2, mod);
      for (long long &x : v) x = (x * _n) % mod;
    }
  }
  vector<long long> multiply(vector<long long> a, vector<long long> b) {
    int n = 1;
    while (n < a.size() + b.size()) n <<= 1;
    a.resize(n);
    b.resize(n);
    fft(a);
    fft(b);
    for (int i = 0; i < n; i++) a[i] = (a[i] * b[i]) % mod;
    fft(a, true);
    return a;
  }
};
vector<long long> gun(vector<vector<long long> > w) {
  NTT ntt(998244353, 15311432, 469870224, 1 << 23);
  priority_queue<pair<int, int> > pq;
  for (int i = 0; i < w.size(); i++) {
    pq.emplace(-int(w[i].size()), i);
  }
  while (pq.size() > 1) {
    pair<int, int> u = pq.top();
    pq.pop();
    pair<int, int> v = pq.top();
    pq.pop();
    w[u.second] = ntt.multiply(w[u.second], w[v.second]);
    while (w[u.second].size() > 1 && w[u.second].back() == 0)
      w[u.second].pop_back();
    pq.emplace(-int(w[u.second].size()), u.second);
  }
  return w[pq.top().second];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, vector<long long> > mp;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    auto it = mp.find(x);
    if (it == mp.end()) mp[x].push_back(1);
    mp[x].push_back(1);
  }
  vector<vector<long long> > w;
  for (auto pr : mp) w.push_back(pr.second);
  vector<long long> v = gun(w);
  cout << v[n / 2] << "\n";
  return 0;
}
