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 N = 200010;
const int M = 3000010;
int n, a, frq[M];
vector<int> v;
namespace FFT {
const double C_PI = acos(-1);
void fft(vector<complex<double> > &a, bool invert) {
  int n = ((int)(a).size());
  for (int i = 0, j = 0; i < n; ++i) {
    if (i > j) swap(a[i], a[j]);
    for (int k = n >> 1; (j ^= k) < k; k >>= 1)
      ;
  }
  for (int len = 2; len <= n; len <<= 1) {
    double ang = 2 * C_PI / len * (invert ? -1 : 1);
    complex<double> wlen(cos(ang), sin(ang));
    for (int i = 0; i < n; i += len) {
      complex<double> w(1);
      for (int j = 0; j < len / 2; j++) {
        if ((j & 511) == 511) w = complex<double>(cos(ang * j), sin(ang * j));
        complex<double> u = a[i + j], v = a[i + j + len / 2] * w;
        a[i + j] = u + v;
        a[i + j + len / 2] = u - v;
        w *= wlen;
      }
    }
  }
  if (invert) {
    for (int i = 0; i < n; i++) a[i] /= n;
  }
}
void multiply(const vector<int> &a, const vector<int> &b, vector<int> &res,
              const int MOD) {
  vector<complex<double> > fa((a).begin(), (a).end()),
      fb((b).begin(), (b).end());
  int n = 1;
  while (n < max(((int)(a).size()), ((int)(b).size()))) n <<= 1;
  n <<= 1;
  fa.resize(n);
  fb.resize(n);
  fft(fa, false);
  fft(fb, false);
  for (int i = 0; i < n; i++) fa[i] *= fb[i];
  fft(fa, true);
  res.resize(n);
  for (int i = 0; i < n; i++)
    res[i] =
        ((long long)(fa[i].real() + (fa[i].real() > 0 ? 0.5 : -0.5))) % MOD;
}
void multiply_with_modulo(const vector<int> &a, const vector<int> &b,
                          vector<int> &res, const int MOD) {
  int n = 1;
  while (n < max(((int)(a).size()), ((int)(b).size()))) n <<= 1;
  n <<= 1;
  vector<complex<double> > A(n), B(n);
  int L_BLOCK = 15;
  for (int i = 0; i < n; i++)
    A[i] = (i < ((int)(a).size())
                ? complex<double>(a[i] & ((1 << L_BLOCK) - 1), a[i] >> L_BLOCK)
                : complex<double>(0));
  for (int i = 0; i < n; i++)
    B[i] = (i < ((int)(b).size())
                ? complex<double>(b[i] & ((1 << L_BLOCK) - 1), b[i] >> L_BLOCK)
                : complex<double>(0));
  fft(A, false);
  fft(B, false);
  vector<complex<double> > f1(n), f2(n), f3(n), f4(n);
  for (int i = 0; i < n; i++) {
    int j = (n - i) & (n - 1);
    f2[i] = (A[i] + conj(A[j])) * complex<double>(0.5, 0);
    f1[i] = (A[i] - conj(A[j])) * complex<double>(0, -0.5);
    f4[i] = (B[i] + conj(B[j])) * complex<double>(0.5, 0);
    f3[i] = (B[i] - conj(B[j])) * complex<double>(0, -0.5);
  }
  for (int i = 0; i < n; i++) {
    A[i] = f1[i] * f3[i] + f1[i] * f4[i] * complex<double>(0, 1);
    B[i] = f2[i] * f4[i] * complex<double>(0, 1) + f2[i] * f3[i];
  }
  fft(A, true);
  fft(B, true);
  res.resize(n);
  for (int i = 0; i < n; i++) {
    long long g1 = (long long)(A[i].real() + 0.5) % MOD;
    long long g2 = (long long)(A[i].imag() + 0.5) % MOD;
    long long g3 = (long long)(B[i].real() + 0.5) % MOD;
    long long g4 = (long long)(B[i].imag() + 0.5) % MOD;
    res[i] = (g4 + ((g2 + g3) << L_BLOCK) + (g1 << (L_BLOCK << 1))) % MOD;
  }
}
void multiply_big(const vector<int> &a, const vector<int> &b,
                  vector<long long> &res) {
  int n = 1;
  while (n < max(((int)(a).size()), ((int)(b).size()))) n <<= 1;
  n <<= 1;
  vector<complex<double> > A(n), B(n);
  int L_BLOCK = 10;
  for (int i = 0; i < n; i++)
    A[i] = (i < ((int)(a).size())
                ? complex<double>(a[i] & ((1 << L_BLOCK) - 1), a[i] >> L_BLOCK)
                : complex<double>(0));
  for (int i = 0; i < n; i++)
    B[i] = (i < ((int)(b).size())
                ? complex<double>(b[i] & ((1 << L_BLOCK) - 1), b[i] >> L_BLOCK)
                : complex<double>(0));
  fft(A, false);
  fft(B, false);
  vector<complex<double> > f1(n), f2(n), f3(n), f4(n);
  for (int i = 0; i < n; i++) {
    int j = (n - i) & (n - 1);
    f2[i] = (A[i] + conj(A[j])) * complex<double>(0.5, 0);
    f1[i] = (A[i] - conj(A[j])) * complex<double>(0, -0.5);
    f4[i] = (B[i] + conj(B[j])) * complex<double>(0.5, 0);
    f3[i] = (B[i] - conj(B[j])) * complex<double>(0, -0.5);
  }
  for (int i = 0; i < n; i++) {
    A[i] = f1[i] * f3[i] + f1[i] * f4[i] * complex<double>(0, 1);
    B[i] = f2[i] * f4[i] * complex<double>(0, 1) + f2[i] * f3[i];
  }
  fft(A, true);
  fft(B, true);
  res.resize(n);
  for (int i = 0; i < n; i++) {
    long long g1 = (long long)(A[i].real() + 0.5);
    long long g2 = (long long)(A[i].imag() + 0.5);
    long long g3 = (long long)(B[i].real() + 0.5);
    long long g4 = (long long)(B[i].imag() + 0.5);
    res[i] = (g4 + ((g2 + g3) << (L_BLOCK)) + (g1 << (L_BLOCK << 1)));
  }
}
}  // namespace FFT
vector<int> cur[4 * N];
vector<int> sum;
void calc(int l, int r, int idx) {
  if (l == r) {
    cur[idx].resize(v[l] + 1, 1);
    return;
  }
  if (l == r - 1) {
    calc(l, (r + l) / 2, (idx << 1));
    calc(((l + r) >> 1) + 1, r, (idx << 1) ^ 1);
  } else {
    int mid = lower_bound(sum.begin(), sum.end(),
                          (sum[r] - (l == 0 ? 0 : sum[l - 1])) / 2 + sum[l]) -
              sum.begin();
    calc(l, mid - 1, (idx << 1));
    calc(mid, r, (idx << 1) ^ 1);
  }
  FFT::multiply_with_modulo(cur[(idx << 1)], cur[(idx << 1) ^ 1], cur[idx],
                            998244353);
  while ((int)cur[idx].size() > 0 && cur[idx].back() == 0) cur[idx].pop_back();
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    frq[a]++;
  }
  for (int i = 0; i < M; i++) {
    if (frq[i] > 0) v.push_back(frq[i]);
  }
  sort(v.begin(), v.end());
  sum.resize((int)v.size(), 0);
  for (int i = 0; i < (int)sum.size(); i++) {
    sum[i] = v[i];
    if (i) sum[i] += sum[i - 1];
  }
  calc(0, (int)v.size() - 1, 1);
  cout << cur[1][n / 2] << endl;
  return 0;
}
