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;
typedef pair<long long *, int> Poly;
const int N = 3e6 + 5;
int a[N], b[1 << 18];
long long mi(long long x, int y = mod - 2) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = ans * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
namespace NTT {
const int N = 1 << 18;
long long a[N], b[N], w[N];
int rev[N];
void ntt(long long a[], int n, int flag) {
  for (int i = 1; i <= n - 1; ++i) rev[i] = rev[i / 2] / 2 + i % 2 * n / 2;
  for (int i = 1; i <= n - 1; ++i)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int i = 1; i < n; i *= 2) {
    int nn = i * 2;
    long long wn = mi(3, mod - 1 + (mod - 1) / nn * flag);
    w[0] = 1;
    for (int k = 1; k <= i - 1; ++k) w[k] = w[k - 1] * wn % mod;
    for (int j = 0; j < n; j += nn) {
      long long *a1 = a + j, *a2 = a1 + i;
      for (int k = 0; k <= i - 1; ++k) {
        long long x = a1[k], y = a2[k] * w[k] % mod;
        a1[k] = (x + y) % mod;
        a2[k] = (x - y) % mod;
      }
    }
  }
  if (flag == -1) {
    long long niv_n = mi(n);
    for (int i = 0; i <= n - 1; ++i) a[i] = a[i] * niv_n % mod;
  }
}
void mul(int n0) {
  int n = 1;
  while (n <= n0) n *= 2;
  for (int i = n0 + 1; i <= n - 1; ++i) a[i] = b[i] = 0;
  ntt(a, n, 1);
  ntt(b, n, 1);
  for (int i = 0; i <= n - 1; ++i) a[i] = a[i] * b[i] % mod;
  ntt(a, n, -1);
}
};  // namespace NTT
Poly solve(int l, int r) {
  if (l == r) {
    long long *f = new long long[a[b[l]] + 1];
    for (int i = 0; i <= a[b[l]]; ++i) f[i] = 1;
    return Poly(f, a[b[l]]);
  }
  int mid = (l + r) / 2;
  Poly fl = solve(l, mid), fr = solve(mid + 1, r);
  int n = fl.second + fr.second;
  for (int i = 0; i <= n; ++i) NTT::a[i] = NTT::b[i] = 0;
  for (int i = 0; i <= fl.second; ++i) NTT::a[i] = fl.first[i];
  for (int i = 0; i <= fr.second; ++i) NTT::b[i] = fr.first[i];
  NTT::mul(n);
  long long *f = new long long[n + 1];
  for (int i = 0; i <= n; ++i) f[i] = NTT::a[i];
  return Poly(f, n);
}
void init() { return; }
int main() {
  init();
  int n, m, k = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &m);
    if (a[m] == 0) b[++k] = m;
    ++a[m];
  }
  Poly f = solve(1, k);
  printf("%lld\n", (f.first[n / 2] + mod) % mod);
}
