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>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
unsigned int add(const unsigned int x, const unsigned int y) {
  return (x + y < 998244353) ? x + y : x + y - 998244353;
}
unsigned int sub(const unsigned int x, const unsigned int y) {
  return (x >= y) ? (x - y) : (998244353 - y + x);
}
unsigned int mul(const unsigned int x, const unsigned int y) {
  return (unsigned long long)x * y % 998244353;
}
unsigned int mod_pow(unsigned int x, unsigned int n) {
  unsigned int res = 1;
  while (n > 0) {
    if (n & 1) {
      res = mul(res, x);
    }
    x = mul(x, x);
    n >>= 1;
  }
  return res;
}
unsigned int inverse(const unsigned int x) { return mod_pow(x, 998244353 - 2); }
void ntt(vector<int>& a, const bool rev = false) {
  unsigned int i, j, k, l, p, q, r, s;
  const unsigned int size = a.size();
  if (size == 1) return;
  vector<int> b(size);
  r = rev ? (998244353 - 1 - (998244353 - 1) / size) : (998244353 - 1) / size;
  s = mod_pow(3, r);
  vector<unsigned int> kp(size / 2 + 1, 1);
  for (i = 0; i < size / 2; ++i) kp[i + 1] = mul(kp[i], s);
  for (i = 1, l = size / 2; i < size; i <<= 1, l >>= 1) {
    for (j = 0, r = 0; j < l; ++j, r += i) {
      for (k = 0, s = kp[i * j]; k < i; ++k) {
        p = a[k + r], q = a[k + r + size / 2];
        b[k + 2 * r] = add(p, q);
        b[k + 2 * r + i] = mul(sub(p, q), s);
      }
    }
    swap(a, b);
  }
  if (rev) {
    s = inverse(size);
    for (i = 0; i < size; i++) {
      a[i] = mul(a[i], s);
    }
  }
}
vector<int> convolute(const vector<int>& a, const vector<int>& b) {
  const int size = (int)a.size() + (int)b.size() - 1;
  int t = 1;
  while (t < size) {
    t <<= 1;
  }
  vector<int> A(t, 0), B(t, 0);
  for (int i = 0; i < (int)a.size(); i++) {
    A[i] = a[i];
  }
  for (int i = 0; i < (int)b.size(); i++) {
    B[i] = b[i];
  }
  ntt(A), ntt(B);
  for (int i = 0; i < t; i++) {
    A[i] = mul(A[i], B[i]);
  }
  ntt(A, true);
  A.resize(size);
  return A;
}
vector<int> calc(vector<int> v) {
  if (v.size() == 1) {
    return vector<int>(v[0] + 1, 1);
  }
  int sum = accumulate(v.begin(), v.end(), 0);
  int lsum = 0;
  vector<int> vl, vr;
  for (int x : v) {
    if (2 * lsum < sum) {
      vl.push_back(x);
      lsum += x;
    } else {
      vr.push_back(x);
    }
  }
  if (vr.empty()) {
    vr.push_back(vl.back());
    vl.pop_back();
  }
  return convolute(calc(vl), calc(vr));
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(10) << fixed;
  int n;
  cin >> n;
  map<int, int> cnt;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    if (cnt.count(p))
      cnt[p]++;
    else
      cnt[p] = 1;
  }
  vector<int> v;
  for (auto [a, b] : cnt) v.push_back(b);
  auto u = calc(v);
  cout << u[n / 2] << endl;
}
