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 warning(disable : 4996)
using namespace std;
using ld = long double;
template <class T>
using Table = vector<vector<T>>;
const ld eps = 1e-9;
template <class S, class T>
ostream &operator<<(ostream &os, const pair<S, T> v) {
  os << "( " << v.first << ", " << v.second << ")";
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (int i = 0; i < v.size(); i++) {
    if (i > 0) {
      os << " ";
    }
    os << v[i];
  }
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
  for (int i = 0; i < v.size(); i++) {
    if (i > 0) {
      os << endl;
    }
    os << v[i];
  }
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<set<T>> &v) {
  for (int i = 0; i < v.size(); i++) {
    if (i > 0) {
      os << endl;
    }
    os << v[i];
  }
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const set<T> &v) {
  int i = 0;
  for (auto it : v) {
    if (i > 0) {
      os << ' ';
    }
    os << it;
    i++;
  }
  return os;
}
template <class T, class TT>
ostream &operator<<(ostream &os, const map<T, TT> &v) {
  int i = 0;
  for (auto it : v) {
    if (i > 0) {
      os << ' ';
    }
    os << it;
    i++;
  }
  return os;
}
using ll = long long;
namespace NTT {
using uint = uint_fast32_t;
constexpr ll NTT_PRIMES[][2] = {
    {1224736769, 3}, {1053818881, 7}, {1051721729, 6}, {1045430273, 3},
    {1012924417, 5}, {1007681537, 3}, {1004535809, 3}, {998244353, 3},
    {985661441, 3},  {976224257, 3},  {975175681, 17}, {962592769, 7},
    {950009857, 7},  {943718401, 7},  {935329793, 3},  {924844033, 5},
    {469762049, 3},  {167772161, 3},
};
ll extgcd(ll a, ll b, ll &x, ll &y) {
  ll d;
  return b == 0 ? (x = a < 0 ? -1 : 1, y = 0, a < 0 ? -a : a)
                : (d = extgcd(b, a % b, y, x), y -= a / b * x, d);
}
ll modinv(ll a, ll mod) {
  ll x, y;
  extgcd(a, mod, x, y);
  x %= mod;
  return x < 0 ? x + mod : x;
}
ll modpow(ll a, ll b, ll mod) {
  ll r = 1;
  a %= mod;
  while (b) {
    if (b & 1) r = r * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return r;
}
template <int MAX_H>
struct Pool {
  static ll *tmp, *A, *B;
};
template <int MAX_H>
ll *Pool<MAX_H>::tmp = new ll[1 << MAX_H];
template <int MAX_H>
ll *Pool<MAX_H>::A = new ll[1 << MAX_H];
template <int MAX_H>
ll *Pool<MAX_H>::B = new ll[1 << MAX_H];
template <int MAX_H, ll mod, ll primitive>
class Core {
 public:
  static_assert((mod & ((1 << MAX_H) - 1)) == 1,
                "mod is too small; comment out");
  ll zetaList[MAX_H], zetaInvList[MAX_H];
  Core() {
    zetaList[MAX_H - 1] = modpow(primitive, (mod - 1) / (1 << MAX_H), mod);
    zetaInvList[MAX_H - 1] = modinv(zetaList[MAX_H - 1], mod);
    for (int ih = MAX_H - 2; ih >= 0; --ih) {
      zetaList[ih] = zetaList[ih + 1] * zetaList[ih + 1] % mod;
      zetaInvList[ih] = zetaInvList[ih + 1] * zetaInvList[ih + 1] % mod;
    }
  }
  void fft(ll *a, uint n, uint nh, bool inverse) const {
    ll *tmp = Pool<MAX_H>::tmp;
    uint mask = n - 1;
    for (uint i = n >> 1, ih = nh - 1; i >= 1; i >>= 1, --ih) {
      ll zeta = inverse ? zetaInvList[nh - 1 - ih] : zetaList[nh - 1 - ih];
      ll powZeta = 1;
      for (uint j = 0; j < n; j += i) {
        for (uint k = 0; k < i; ++k) {
          tmp[j | k] = (a[((j << 1) & mask) | k] +
                        powZeta * a[(((j << 1) | i) & mask) | k]) %
                       mod;
        }
        powZeta = powZeta * zeta % mod;
      }
      swap(a, tmp);
    }
    if (nh & 1) {
      swap(a, tmp);
      for (uint i = 0; i < n; ++i) a[i] = tmp[i];
    }
    if (inverse) {
      ll invN = modinv(n, mod);
      for (uint i = 0; i < n; ++i) a[i] = a[i] * invN % mod;
    }
  }
  vector<ll> conv(const vector<ll> &a, const vector<ll> &b) const {
    uint t = a.size() + b.size() - 1;
    uint n = 1, nh = 0;
    while (n < t) n <<= 1, ++nh;
    return convStrict(a, b, n, nh);
  }
  vector<ll> convStrict(const vector<ll> &a, const vector<ll> &b, uint n,
                        uint nh) const {
    ll *A = Pool<MAX_H>::A, *B = Pool<MAX_H>::B;
    for (uint i = 0; i < n; ++i) A[i] = B[i] = 0;
    copy(a.begin(), a.end(), A);
    copy(b.begin(), b.end(), B);
    fft(A, n, nh, 0), fft(B, n, nh, 0);
    for (uint i = 0; i < n; ++i) A[i] = A[i] * B[i] % mod;
    fft(A, n, nh, 1);
    return vector<ll>(A, A + n);
  }
};
}  // namespace NTT
NTT::Core<18, NTT::NTT_PRIMES[0][0], NTT::NTT_PRIMES[0][1]> nttBig;
NTT::Core<18, 998244353, 5> ntt;
vector<ll> solve(const vector<int> &v, int l, int r) {
  if (l + 1 == r) {
    return vector<ll>(v[l] + 1, 1);
  }
  int sum = accumulate(v.begin() + l, v.begin() + r, 0);
  int x = l;
  int cnt = 0;
  for (; x < r; ++x) {
    if (cnt + v[x] > sum / 2) {
      auto al = solve(v, l, x);
      auto ar = solve(v, x, r);
      auto av = ntt.conv(al, ar);
      av.resize(sum + 1);
      return av;
    }
    cnt += v[x];
  }
  return vector<ll>{1};
}
int main() {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  map<int, int> mp;
  for (int i = 0; i < N; ++i) {
    int a;
    cin >> a;
    mp[a]++;
  }
  vector<int> v;
  for (auto m : mp) v.push_back(m.second);
  sort(v.begin(), v.end());
  auto answer = solve(v, 0, v.size());
  cout << answer[(N) / 2] << endl;
  return 0;
}
