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;
long long mulmod(long long a, long long b) { return (a * b) % 998244353; }
long long pm(long long a, long long e) {
  long long r = 1;
  while (e) {
    if (e & 1) r = mulmod(r, a);
    e >>= 1;
    a = mulmod(a, a);
  }
  return r;
}
long long inv(long long a) { return pm(a, 998244353 - 2); }
struct CD {
  long long x;
  CD(long long x) : x(x) {}
  CD() {}
  long long get() const { return x; }
};
CD operator*(const CD& a, const CD& b) { return CD(mulmod(a.x, b.x)); }
CD operator+(const CD& a, const CD& b) { return CD((a.x + b.x) % 998244353); }
CD operator-(const CD& a, const CD& b) {
  return CD((a.x + 998244353 - b.x) % 998244353);
}
CD cp1[(1 << 19) + 9], cp2[(1 << 19) + 9];
int R[(1 << 19) + 9];
CD root(int n, bool inv) {
  long long r = pm(3, (998244353 - 1) / n);
  return CD(inv ? pm(r, 998244353 - 2) : r);
}
void dft(CD* a, int n, bool inv) {
  for (int i = 0, ThxDem = n; i < ThxDem; ++i)
    if (R[i] < i) swap(a[R[i]], a[i]);
  for (int m = 2; m <= n; m *= 2) {
    CD wi = root(m, inv);
    for (int j = 0; j < n; j += m) {
      CD w(1);
      for (int k = j, k2 = j + m / 2; k2 < j + m; k++, k2++) {
        CD u = a[k];
        CD v = a[k2] * w;
        a[k] = u + v;
        a[k2] = u - v;
        w = w * wi;
      }
    }
  }
  if (inv) {
    CD z(pm(n, 998244353 - 2));
    for (int i = 0, ThxDem = n; i < ThxDem; ++i) a[i] = a[i] * z;
  }
}
vector<long long> multiply(vector<long long>& p1, vector<long long>& p2) {
  int n = p1.size() + p2.size() + 1;
  int m = 1, cnt = 0;
  while (m <= n) m += m, cnt++;
  for (int i = 0, ThxDem = m; i < ThxDem; ++i) {
    R[i] = 0;
    for (int j = 0, ThxDem = cnt; j < ThxDem; ++j)
      R[i] = (R[i] << 1) | ((i >> j) & 1);
  }
  for (int i = 0, ThxDem = m; i < ThxDem; ++i) cp1[i] = 0, cp2[i] = 0;
  for (int i = 0, ThxDem = p1.size(); i < ThxDem; ++i) cp1[i] = p1[i];
  for (int i = 0, ThxDem = p2.size(); i < ThxDem; ++i) cp2[i] = p2[i];
  dft(cp1, m, false);
  dft(cp2, m, false);
  for (int i = 0, ThxDem = m; i < ThxDem; ++i) cp1[i] = cp1[i] * cp2[i];
  dft(cp1, m, true);
  vector<long long> res;
  n -= 2;
  for (int i = 0, ThxDem = n; i < ThxDem; ++i)
    res.push_back((long long)floor(cp1[i].get()));
  return res;
}
vector<vector<long long>> v;
vector<long long> solve(int l, int r) {
  if (l + 1 == r) return v[l];
  int m = (l + r) / 2;
  auto x = solve(l, m), y = solve(m, r);
  return multiply(x, y);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  a.push_back(1e9);
  int am = 1;
  for (int i = 1, ThxDem = int(a.size()); i < ThxDem; ++i) {
    if (a[i] != a[i - 1])
      v.push_back(vector<long long>(am + 1, 1)), am = 1;
    else
      am++;
  }
  vector<long long> ans = solve(0, int(v.size()));
  cout << ans[n / 2] << "\n";
}
