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;
template <class T>
using v2d = vector<vector<T>>;
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
mt19937 rng(chrono::system_clock::now().time_since_epoch().count());
const int maxN = 2e5 + 10;
const int maxP = 3e6 + 10;
const long long mod = 998244353;
int n, m, cnt[maxP];
vector<vector<int>> vec;
priority_queue<pair<int, int>, vector<pair<int, int>>, greater<pair<int, int>>>
    pq;
long long power(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) {
      r = r * a % mod;
    }
    b /= 2;
    a = a * a % mod;
  }
  return r;
}
int rev(int x, int lg) {
  int ans = 0;
  for (int i = 0; i < (int)(lg); ++i) {
    ans |= (x >> i & 1) << (lg - i - 1);
  }
  return ans;
}
void relax(int &a) {
  if (a >= mod) {
    a -= mod;
  }
}
void fft(vector<int> &a, int g) {
  int n = (int)a.size();
  int lg = 31 - __builtin_clz(n);
  vector<int> b(n);
  for (int i = 0; i < (int)(n); ++i) {
    b[rev(i, lg)] = a[i];
  }
  a = b;
  for (int len = 2; len <= n; len *= 2) {
    long long wlen = power(g, (mod - 1) / len);
    for (int i = 0; i < n; i += len) {
      long long w = 1;
      for (int j = i; j < i + len / 2; j++) {
        long long u = a[j], v = w * a[j + len / 2] % mod;
        a[j] = u + v;
        a[j + len / 2] = u - v + mod;
        relax(a[j]);
        relax(a[j + len / 2]);
        w = w * wlen % mod;
      }
    }
  }
}
vector<int> mul(vector<int> &a, vector<int> &b) {
  int n = 1;
  while (n < (int)a.size() + (int)b.size()) {
    n *= 2;
  }
  a.resize(n);
  b.resize(n);
  fft(a, 3);
  fft(b, 3);
  for (int i = 0; i < (int)(n); ++i) {
    a[i] = (long long)a[i] * b[i] % mod;
  }
  fft(a, power(3, mod - 2));
  long long inv_n = power(n, mod - 2);
  for (int i = 0; i < (int)(n); ++i) {
    a[i] = a[i] * inv_n % mod;
  }
  return a;
}
void solve() {
  cin >> n;
  for (int i = 1; i <= (int)(n); ++i) {
    int p;
    cin >> p;
    cnt[p]++;
  }
  for (int i = (int)(2); i <= (int)(3e6); ++i) {
    if (cnt[i] > 0) {
      vec.emplace_back(vector<int>(cnt[i] + 1, 1));
    }
  }
  m = (int)vec.size();
  for (int i = 0; i < (int)(m); ++i) {
    pq.emplace((int)vec[i].size(), i);
  }
  while ((int)pq.size() > 1) {
    int i = pq.top().second;
    pq.pop();
    int j = pq.top().second;
    pq.pop();
    vec[i] = mul(vec[i], vec[j]);
    pq.emplace((int)vec[i].size(), i);
  }
  cout << vec[pq.top().second][n / 2];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
