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 SMALL_SZ = 100;
const int MOD = 998244353;
int root;
int root_i;
int root_pw = 1 << 23;
int itwo = 499122177;
int fac[600600];
int ifac[600600];
int iv[600600];
int tpow[600600];
void setup() {
  int r = 3;
  int ri = 332748118;
  root = 1;
  root_i = 1;
  for (int i = 0; i < 119; ++i) {
    root = (long long)root * r % MOD;
    root_i = (long long)root_i * ri % MOD;
  }
  iv[0] = iv[1] = 1;
  for (int i = 2; i < 600600; ++i) {
    iv[i] = (MOD - (long long)(MOD / i) * iv[MOD % i] % MOD) % MOD;
  }
  fac[0] = 1;
  fac[1] = 1;
  ifac[0] = 1;
  ifac[1] = 1;
  tpow[0] = 1;
  tpow[1] = 2;
  for (long long i = 2; i < 600600; ++i) {
    fac[i] = (long long)fac[i - 1] * i % MOD;
    ifac[i] = (long long)ifac[i - 1] * iv[i] % MOD;
    tpow[i] = tpow[i - 1] * 2 % MOD;
  }
}
namespace ntt {
void rfft(vector<int>& v, int dir) {
  int n = v.size();
  for (int i = 1, j = 0; i < n; ++i) {
    int z = n / 2;
    for (; j >= z; z /= 2) j -= z;
    j += z;
    if (i < j) swap(v[i], v[j]);
  }
  for (int j = 2; j <= n; j *= 2) {
    int w = dir == 1 ? root : root_i;
    for (long long i = j; i < root_pw; i *= 2) {
      w = (long long)w * w % MOD;
    }
    for (int i = 0; i < n; i += j) {
      int b = 1;
      for (int k = i; k < i + j / 2; k++) {
        int a1 = v[k], a2 = (long long)b * v[k + j / 2] % MOD;
        v[k] = (a1 + a2) % MOD;
        v[k + j / 2] = (a1 - a2 + MOD) % MOD;
        b = (long long)b * w % MOD;
      }
    }
  }
  if (dir == -1) {
    int w = 1;
    for (int z = 1; z < n; z <<= 1) {
      w = ((long long)w * itwo) % MOD;
    }
    for (int i = 0; i < n; ++i) {
      v[i] = (long long)v[i] * w % MOD;
    }
  }
}
vector<int> conv_small(const vector<int>& a, const vector<int>& b) {
  if (a.size() < b.size()) return conv_small(b, a);
  vector<int> ans(a.size() + b.size() - 1, 0);
  for (int i = 0; i < a.size(); ++i) {
    for (int j = 0; j < b.size(); ++j) {
      ans[i + j] = (ans[i + j] + (long long)a[i] * b[j]) % MOD;
    }
  }
  return ans;
}
vector<int> conv(vector<int> a, vector<int> b) {
  if (a.size() < SMALL_SZ || b.size() < SMALL_SZ) {
    return conv_small(a, b);
  }
  int nn = a.size() + b.size() - 2;
  int mm = a.size() + b.size() - 1;
  nn = 1 << (32 - __builtin_clz(nn));
  a.resize(nn, 0);
  b.resize(nn, 0);
  rfft(a, 1);
  rfft(b, 1);
  for (int i = 0; i < nn; ++i) a[i] = (long long)a[i] * b[i] % MOD;
  rfft(a, -1);
  a.resize(mm);
  return a;
}
};  // namespace ntt
map<int, int> mp;
int n;
vector<int> merge(const vector<vector<int>>& polys, int l, int r) {
  assert(l < r);
  if (r - l == 1) return polys[l];
  pair<long long, long long> best(1e9, l + 1);
  int h = 0, x = 0;
  for (int i = l; i < r; ++i) {
    h += polys[i].size();
  }
  for (int i = l; i < r - 1; ++i) {
    h -= polys[i].size();
    x += polys[i].size();
    best = min(best, pair<long long, long long>(max(x, h), i + 1));
  }
  int m = best.second;
  vector<int> a = merge(polys, l, m);
  vector<int> b = merge(polys, m, r);
  return ntt::conv(a, b);
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  setup();
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int p;
    cin >> p;
    mp[p]++;
  }
  vector<vector<int>> polys;
  for (auto& p : mp) {
    polys.push_back(vector<int>(p.second + 1, 1));
  }
  auto g = merge(polys, 0, polys.size());
  cerr << g.size() << endl;
  cout << g[n / 2] << endl;
  return 0;
}
