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>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const int N = 1000500;
const int N1 = 100500;
const long long mod = 998244353;
const long double PI = acos(-1);
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int xd[3000500];
int inver[2 * 400500];
vector<int> answer;
vector<pair<int, int>> weada;
vector<vector<int>> weada2;
int ma[200500];
vector<int> usa;
struct NNT {
  int root_i, root, root_pw;
  inline int bpow(int a, long long b) {
    if (b == 0) return 1;
    int ans = bpow(a, b / 2);
    if (b % 2 == 0)
      return (int)((1LL * ans * ans) % mod);
    else
      return (int)(((1LL * ans * ans) % mod * a) % mod);
  }
  inline void invoker(vector<int>& v, bool invert) {
    int n = v.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(v[i], v[j]);
    }
    for (int len = 2; len <= n; len <<= 1) {
      int wlen = invert ? root_i : root;
      for (int i = len; i < root_pw; i <<= 1) {
        wlen = (int)((1LL * wlen * wlen) % mod);
        if (wlen < 0) wlen += mod;
      }
      for (int i = 0; i < n; i += len) {
        int w = 1;
        for (int j = 0; j < (len / 2); j++) {
          int u = v[i + j];
          int vi = (int)((1LL * v[i + j + len / 2] * w) % mod);
          v[i + j] = ((u + vi) < mod) ? (u + vi) : (u + vi - mod);
          v[i + j + len / 2] = ((u - vi) >= 0) ? (u - vi) : (u - vi + mod);
          w = (int)((1LL * w * wlen) % mod);
          if (w < 0) w += mod;
        }
      }
    }
    if (invert) {
      int n_1 = inver[n];
      for (int i = 0; i < n; i++) {
        v[i] = (int)((1LL * v[i] * n_1) % mod);
        if (v[i] < 0) v[i] += mod;
      }
    }
  }
  inline vector<int> multi(vector<int> v1, vector<int> v2) {
    int lg_n = 0;
    int maxi = (v1.size() + v2.size());
    while ((1 << lg_n) < maxi) lg_n++;
    v1.resize(1 << lg_n);
    v2.resize(1 << lg_n);
    invoker(v1, false);
    invoker(v2, false);
    int maxi2 = 1 << lg_n;
    for (int i = 0; i < maxi2; i++) v1[i] = (int)((1LL * v1[i] * v2[i]) % mod);
    invoker(v1, true);
    return v1;
  }
  inline vector<int> invo_pow(vector<int>& v1, int b) {
    if (b == 0) return v1;
    int lg_n = 0;
    while ((1 << lg_n) < v1.size() * b) lg_n++;
    v1.resize(1 << lg_n);
    invoker(v1, false);
    for (int i = 0; i < (1 << lg_n); i++) {
      v1[i] = bpow(v1[i], b) % mod;
      if (v1[i] < 0) v1[i] += mod;
    }
    invoker(v1, true);
    return v1;
  }
  inline vector<int> divide_conquer(int l, int r) {
    if (l == r) {
      vector<int> xd;
      for (int i = 0; i <= weada[l].first; i++) xd.push_back(1);
      return invo_pow(xd, weada[l].second);
    }
    int mid = (l + r) / 2;
    vector<int> v1 = divide_conquer(l, mid);
    vector<int> v2 = divide_conquer(mid + 1, r);
    return multi(v1, v2);
  }
} F;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < 2 * 400500; i++) inver[i] = F.bpow(i, mod - 2);
  F.root = 31;
  F.root_i = F.bpow(F.root, mod - 2);
  F.root_pw = (1 << 23);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    xd[a]++;
  }
  for (int i = 0; i < 3000500; i++)
    if (xd[i]) ma[xd[i]]++;
  for (int i = 0; i < 200500; i++) {
    if (ma[i]) weada.push_back({i, ma[i]});
  }
  sort(weada.begin(), weada.end());
  usa = F.divide_conquer(0, weada.size() - 1);
  printf("%d\n", usa[n / 2]);
  return 0;
}
