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 mod = 998244353, kMaxP = 3000007, kMaxN = 200007, root = 15311432,
          root_1 = 469870224, root_pw = 1 << 23;
long long binpow(long long a, long long b) {
  a %= mod;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
int inverse(int a) { return binpow(a, mod - 2); }
int counts[kMaxP];
vector<vector<int>> polynomials_of_degree[kMaxN];
void fft(vector<int> *a, bool invert, int *bit_reversal_permutation) {
  int n = a->size();
  for (int i = 1; i < n; i++) {
    if (i < bit_reversal_permutation[i])
      swap((*a)[i], (*a)[bit_reversal_permutation[i]]);
  }
  for (int len = 2; len <= n; len <<= 1) {
    int wlen = invert ? root_1 : root;
    for (int i = len; i < root_pw; i <<= 1)
      wlen = (int)(1LL * wlen * wlen % mod);
    for (int i = 0; i < n; i += len) {
      int w = 1;
      for (int j = 0; j < len / 2; j++) {
        int u = (*a)[i + j], v = (int)(1LL * (*a)[i + j + len / 2] * w % mod);
        (*a)[i + j] = u + v < mod ? u + v : u + v - mod;
        (*a)[i + j + len / 2] = u - v >= 0 ? u - v : u - v + mod;
        w = (int)(1LL * w * wlen % mod);
      }
    }
  }
  if (invert) {
    int n_1 = inverse(n);
    for (int &x : (*a)) x = (int)(1LL * x * n_1 % mod);
  }
}
vector<int> multiply(vector<int> const &a, vector<int> const &b) {
  vector<int> fa(a.begin(), a.end()), fb(b.begin(), b.end());
  ;
  int n = 1;
  while (n < (static_cast<int>((a).size())) + (static_cast<int>((b).size())))
    n <<= 1;
  fa.resize(n);
  fb.resize(n);
  int bit_reversal_permutation[n];
  for (int i = 1, j = 0; i < n; i++) {
    int bit = n >> 1;
    for (; j & bit; bit >>= 1) j ^= bit;
    j ^= bit;
    bit_reversal_permutation[i] = j;
  }
  fft(&fa, false, bit_reversal_permutation);
  fft(&fb, false, bit_reversal_permutation);
  for (int i = 0; i < n; i++) fa[i] = int64_t{1} * fa[i] * fb[i] % mod;
  fft(&fa, true, bit_reversal_permutation);
  fa.resize((static_cast<int>((a).size())) + (static_cast<int>((b).size())) -
            1);
  ;
  return fa;
}
int solve() {
  int n;
  cin >> n;
  for (int i = n; i--;) {
    int p;
    cin >> p;
    counts[p]++;
  }
  for (int i = 2; i < kMaxP; i++) {
    if (counts[i] > 0) {
      vector<int> all_ones(counts[i] + 1, 1);
      polynomials_of_degree[counts[i]].emplace_back(all_ones);
      ;
    }
  }
  for (int i = 1; true; i++) {
    while (!polynomials_of_degree[i].empty()) {
      vector<int> a = polynomials_of_degree[i].back();
      polynomials_of_degree[i].pop_back();
      vector<int> b;
      for (int j = i; j < n; j++)
        if (!polynomials_of_degree[j].empty()) {
          b = polynomials_of_degree[j].back();
          polynomials_of_degree[j].pop_back();
          break;
        }
      if (b.empty()) return a[(n >> 1)];
      polynomials_of_degree[(static_cast<int>((a).size())) - 1 +
                            (static_cast<int>((b).size())) - 1]
          .emplace_back(multiply(a, b));
      ;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int test_cases_num = 1;
  for (int i = 1; i <= test_cases_num; i++) {
    if (false)
      if (test_cases_num > 1)
        if (false) cerr << "Test #" << i << ":\n";
    cout << solve() << "\n";
    if (false)
      if (test_cases_num > 1)
        if (false) cerr << "End of test #" << i << ".\n";
  }
  return 0;
}
