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;
int fft_len, fft_lg;
vector<int> r;
void ensure_base(int deg) {
  fft_len = 2, fft_lg = 1;
  while (fft_len <= deg) fft_len <<= 1, fft_lg++;
  r = vector<int>(fft_len, 0);
  for (int i = 0; i < fft_len; ++i)
    r[i] = (r[i >> 1] >> 1) | ((i & 1) << (fft_lg - 1));
}
template <int MOD, int g>
struct NTT {
  int mul(int x, int y) { return 1LL * x * y % MOD; }
  int qpow(int x, int y) {
    int ret = 1;
    for (; y; y >>= 1, x = mul(x, x))
      if (y & 1) ret = mul(ret, x);
    return ret;
  }
  int add(int x, int y) { return x + y >= MOD ? x + y - MOD : x + y; }
  int sub(int x, int y) { return x - y < 0 ? x - y + MOD : x - y; }
  inline int inv(int x) { return qpow(x, MOD - 2); }
  const int ginv = inv(g);
  void fft(vector<int>& A, int dft) {
    for (int i = 0; i < fft_len; ++i)
      if (i < r[i]) swap(A[i], A[r[i]]);
    for (int mid = 1; mid < fft_len; mid <<= 1) {
      int wn = qpow(dft == 1 ? g : ginv, (MOD - 1) / (mid << 1));
      for (int len = mid << 1, j = 0; j < fft_len; j += len) {
        int w = 1;
        for (int k = 0; k < mid; ++k, w = mul(w, wn)) {
          int x = A[j + k], y = mul(w, A[j + k + mid]);
          A[j + k] = add(x, y);
          A[j + k + mid] = sub(x, y);
        }
      }
    }
    if (dft == -1) {
      int invn = inv(fft_len);
      for (int i = 0; i < fft_len; ++i) A[i] = mul(A[i], invn);
    }
  }
  vector<int> pmul(vector<int> A, int degA, vector<int> B, int degB) {
    if (min(degA, degB) <= 150) {
      vector<int> ret(degA + degB + 1);
      for (int i = 0; i <= degA; ++i)
        for (int j = 0; j <= degB; ++j)
          ret[i + j] = add(ret[i + j], mul(A[i], B[j]));
      return ret;
    }
    ensure_base(degA + degB);
    A.resize(fft_len, 0), B.resize(fft_len, 0);
    vector<int> ans(fft_len, 0);
    fft(A, 1), fft(B, 1);
    for (int i = 0; i < fft_len; ++i) ans[i] = mul(A[i], B[i]);
    fft(ans, -1);
    ans.resize(degA + degB + 1);
    return ans;
  }
};
NTT<998244353, 3> ntt;
struct cmp {
  bool operator()(const vector<int>& p1, const vector<int>& p2) {
    return p1.size() > p2.size();
  }
};
int main() {
  int n;
  scanf("%d", &n);
  if (n == 1) {
    puts("1");
    return 0;
  }
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    static int x;
    scanf("%d", &x);
    mp[x]++;
  }
  priority_queue<vector<int>, vector<vector<int> >, cmp> pq;
  for (auto [x, y] : mp) {
    pq.emplace(y + 1, 1);
  }
  while (pq.size() > 1) {
    auto a = pq.top();
    pq.pop();
    auto b = pq.top();
    pq.pop();
    pq.push(ntt.pmul(a, a.size() - 1, b, b.size() - 1));
  }
  printf("%d\n", pq.top().at((n + 1) / 2));
  return 0;
}
