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 long long mod = 998244353;
const long long root = 3;
long long exp(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return ans;
}
void ntt(vector<long long> &a, bool invert) {
  int n = a.size();
  for (int i = 1, j = 0; i < n; i++) {
    int bit = n >> 1;
    for (; j & bit; bit >>= 1) j ^= bit;
    j ^= bit;
    if (i < j) swap(a[i], a[j]);
  }
  for (int len = 2; len <= n; len <<= 1) {
    long long wlen = invert ? exp(root, mod - 1 - (mod - 1) / len)
                            : exp(root, (mod - 1) / len);
    for (int i = 0; i < n; i += len) {
      long long w = 1;
      for (int j = 0; j < len / 2; j++) {
        long long u = a[i + j];
        long long v = (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 = (w * wlen) % mod;
      }
    }
  }
  if (invert) {
    long long n_1 = exp(n, mod - 2);
    for (auto &x : a) x = (x * n_1) % mod;
  }
}
vector<long long> multiply(vector<long long> &a, vector<long long> &b) {
  vector<long long> fa(a.begin(), a.end());
  vector<long long> fb(b.begin(), b.end());
  vector<long long> ans;
  int n = 1;
  while (n < fb.size() + fa.size()) n *= 2;
  fa.resize(n);
  fb.resize(n);
  ntt(fa, 0);
  ntt(fb, 0);
  for (int i = 0; i < fa.size(); i++) fa[i] = (fa[i] * fb[i]) % mod;
  ntt(fa, 1);
  for (int i = 0; i < fa.size(); i++) ans.push_back(fa[i]);
  while (ans.back() == 0) ans.pop_back();
  return ans;
}
vector<long long> v;
vector<long long> solve(int l, int r) {
  if (l == r) {
    vector<long long> a;
    for (int i = 0; i <= v[l]; i++) a.push_back(1);
    return a;
  }
  int mid = (l + r) >> 1;
  auto a = solve(l, mid);
  auto b = solve(mid + 1, r);
  auto c = multiply(a, b);
  return c;
}
const int m = 3e6 + 10;
vector<long long> a(1 << 23);
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int c;
    scanf("%d", &c);
    a[c]++;
  }
  for (int i = 0; i < m; i++)
    if (a[i]) v.push_back(a[i]);
  auto ans = solve(0, v.size() - 1);
  printf("%lld\n", ans[n / 2]);
  return 0;
}
