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 long long mod = 998244353;
const long long INF = (1e+18) + 7;
const long double eps = 1e-6;
const long double pi = acos(-1.0);
long long mod_pow(long long a, long long n) {
  long long res = 1;
  while (n) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
struct modint {
  long long n;
  modint() : n(0) { ; }
  modint(long long m) : n(m) {
    if (n >= mod)
      n %= mod;
    else if (n < 0)
      n = (n % mod + mod) % mod;
  }
  operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) {
  a.n += b.n;
  if (a.n >= mod) a.n -= mod;
  return a;
}
modint operator-=(modint &a, modint b) {
  a.n -= b.n;
  if (a.n < 0) a.n += mod;
  return a;
}
modint operator*=(modint &a, modint b) {
  a.n = ((long long)a.n * b.n) % mod;
  return a;
}
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
  if (n == 0) return modint(1);
  modint res = (a * a) ^ (n / 2);
  if (n % 2) res = res * a;
  return res;
}
long long inv(long long a, long long p) {
  return (a == 1 ? 1 : (1 - p * inv(p % a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
long long mod_inverse(long long a) { return mod_pow(a, mod - 2); }
long long root[24], invroot[24];
void init() {
  for (int i = 0; i < 24; i++) {
    int n = (1 << i);
    root[i] = mod_pow(3, (mod - 1) / n);
    invroot[i] = mod_inverse(root[i]);
  }
}
vector<long long> dft(vector<long long> f, bool inverse = false) {
  int n = f.size();
  int i, j, k;
  for (i = 0, j = 1; j < n - 1; j++) {
    for (k = n >> 1; k > (i ^= k); k >>= 1)
      ;
    if (i > j) swap(f[i], f[j]);
  }
  for (int j = 1; (1 << j) <= n; j++) {
    int m = 1 << j;
    long long zeta = root[j];
    if (inverse) zeta = invroot[j];
    for (i = 0; i < n; i += m) {
      long long powzeta = 1;
      for (k = i; k < i + m / 2; k++) {
        long long t1 = f[k], t2 = powzeta * f[k + m / 2] % mod;
        f[k] = t1 + t2;
        while (f[k] >= mod) f[k] -= mod;
        f[k + m / 2] = t1 - t2 + mod;
        while (f[k + m / 2] >= mod) f[k + m / 2] -= mod;
        (powzeta *= zeta) %= mod;
      }
    }
  }
  if (inverse) {
    long long rv = mod_inverse(n);
    for (i = 0; i < n; i++) {
      (f[i] *= rv) %= mod;
    }
  }
  return f;
}
vector<long long> multiply(vector<long long> g, vector<long long> h) {
  int n = 1;
  int pi = 0, qi = 0;
  for (int i = 0; i < g.size(); i++)
    if (g[i]) pi = i;
  for (int i = 0; i < h.size(); i++)
    if (h[i]) qi = i;
  int sz = pi + qi + 2;
  while (n < sz) n *= 2;
  g.resize(n);
  h.resize(n);
  vector<long long> gg = dft(g);
  vector<long long> hh = dft(h);
  vector<long long> ff;
  ff.resize(n);
  for (int i = 0; i < n; i++) {
    ff[i] = gg[i] * hh[i] % mod;
  }
  return dft(ff, true);
}
vector<long long> powply(vector<long long> x, int n) {
  if (n == 1) return x;
  vector<long long> res = {1};
  while (n > 0) {
    if (n & 1) res = multiply(res, x);
    n >>= 1;
    if (n > 0) x = multiply(x, x);
  }
  return res;
}
using speP = pair<long long, vector<long long>>;
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  vector<int> c;
  for (int i = 0; i < n; i++) {
    int le = i;
    while (i + 1 < n && a[i] == a[i + 1]) i++;
    c.push_back(i - le + 1);
  }
  sort(c.begin(), c.end());
  vector<long long> dp = {1};
  priority_queue<speP, vector<speP>, greater<speP>> q;
  q.push({1, dp});
  for (int i = 0; i < c.size(); i++) {
    int le = i;
    while (i + 1 < c.size() && c[i] == c[i + 1]) i++;
    vector<long long> e = {1};
    for (int j = 0; j < c[i]; j++) e.push_back(1);
    int len = i - le + 1;
    while (len > 0) {
      if (len & 1) q.push({e.size(), e});
      len >>= 1;
      if (len == 0) break;
      e = multiply(e, e);
      if (e.size() > n / 2 + 1) e.resize(n / 2 + 1);
    }
  }
  while (q.size() >= 2) {
    vector<long long> a = q.top().second;
    q.pop();
    vector<long long> b = q.top().second;
    q.pop();
    a = multiply(a, b);
    q.push({a.size(), a});
  }
  dp = q.top().second;
  cout << dp[n / 2] << endl;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  init();
  solve();
  char nyaa;
  cin >> nyaa;
  return 0;
}
