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 RT = 5;
long long mulmod(long long a, long long b) { return (a * b) % MOD; }
long long fp(long long a, long long e) {
  long long r = 1;
  while (e) {
    if (e & 1) r = mulmod(r, a);
    e >>= 1;
    a = mulmod(a, a);
  }
  return r;
}
struct CD {
  long long x;
  CD() {}
  CD(long long x) : x(x) {}
  long long get() const { return x; }
};
CD operator*(const CD& a, const CD& b) { return CD(mulmod(a.x, b.x)); }
CD operator+(const CD& a, const CD& b) { return CD((a.x + b.x) % MOD); }
CD operator-(const CD& a, const CD& b) { return CD((a.x + MOD - b.x) % MOD); }
const long long MX = (1ll << 18);
CD cp1[MX + 9], cp2[MX + 9];
long long R[MX + 9];
CD root(long long n, bool inverso) {
  long long r = fp(RT, (MOD - 1) / n);
  return CD(inverso ? fp(r, MOD - 2) : r);
}
void fft(CD* a, long long n, bool inverso) {
  for (long long i = 0; i < n; i++) {
    if (R[i] < i) swap(a[R[i]], a[i]);
  }
  for (long long m = 2; m <= n; m <<= 1ll) {
    CD wi = root(m, inverso);
    for (long long j = 0; j < n; j += m) {
      CD w(1);
      for (long long k = j, k2 = j + m / 2; k2 < j + m; k++, k2++) {
        CD u = a[k];
        CD v = a[k2] * w;
        a[k] = u + v;
        a[k2] = u - v;
        w = w * wi;
      }
    }
  }
  if (inverso) {
    CD z(fp(n, MOD - 2));
    for (long long i = 0; i < n; i++) a[i] = a[i] * z;
  }
  return;
}
vector<long long> multiply(vector<long long>& p1, vector<long long>& p2) {
  long long n = p1.size() + p2.size() + 1;
  long long m = 1, cnt = 0;
  while (m <= n) {
    m += m;
    cnt++;
  }
  for (long long i = 0; i < m; i++) {
    R[i] = 0;
    for (long long j = 0; j < cnt; j++) {
      R[i] = (R[i] << 1ll) | ((i >> j) & 1);
    }
  }
  for (long long i = 0; i < m; i++) cp1[i] = cp2[i] = 0;
  for (long long i = 0; i < p1.size(); i++) cp1[i] = p1[i];
  for (long long i = 0; i < p2.size(); i++) cp2[i] = p2[i];
  fft(cp1, m, false);
  fft(cp2, m, false);
  for (long long i = 0; i < m; i++) cp1[i] = cp1[i] * cp2[i];
  fft(cp1, m, true);
  vector<long long> result;
  n -= 2;
  for (long long i = 0; i < n; i++) {
    result.push_back(cp1[i].get());
  }
  return result;
}
multiset<pair<long long, vector<long long> > > s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout.precision(10);
  cout << fixed;
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  for (long long i = 0; i < n; i++) {
    long long cnt = 0;
    long long aux = v[i];
    vector<long long> vaux;
    while (i < n && aux == v[i]) {
      i++;
      cnt++;
      vaux.push_back(1);
    }
    vaux.push_back(1);
    i--;
    s.insert({cnt, vaux});
  }
  while (s.size() != 1) {
    vector<long long> A = (*s.begin()).second;
    s.erase(s.begin());
    vector<long long> B = (*s.begin()).second;
    s.erase(s.begin());
    vector<long long> ans = multiply(A, B);
    long long sz = ans.size();
    s.insert({sz, ans});
  }
  vector<long long> A = (*s.begin()).second;
  cout << A[(n + 1) / 2] << "\n";
  return 0;
}
