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>
const double PI = acos(-1.0);
using namespace std;
int setb(int n, int pos) { return n = n | (1 << pos); }
int resb(int n, int pos) { return n = n & ~(1 << pos); }
bool checkb(int n, int pos) { return (bool)(n & (1 << pos)); }
int val;
int cnt[5000000];
vector<int> v;
const int mod = 998244353;
const int root = 31;
const int root_1 = 128805723;
const int root_pw = (1 << 23);
long long bigmod(long long b, long long p) {
  if (p == 0) return 1;
  long long ret = bigmod(b, p / 2);
  ret = (ret * ret) % mod;
  if (p & 1) ret = (ret * b) % mod;
  return ret;
}
int get_root() {
  int r, q;
  for (r = 2; r < mod; r++) {
    if (bigmod(r, root_pw) == 1) {
      for (q = 1; q < root_pw; q++)
        if (bigmod(r, q) == 1) break;
      if (q == root_pw) return r;
    }
  }
  return -1;
}
void fft(vector<int>& a, bool invert) {
  int n = (int)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) {
    int wlen = invert ? root_1 : root;
    for (int i = len; i < root_pw; i <<= 1) wlen = int(wlen * 1ll * wlen % mod);
    for (int i = 0; i < n; i += len) {
      int w = 1;
      for (int j = 0; j < len / 2; ++j) {
        int u = a[i + j], v = int(a[i + j + len / 2] * 1ll * 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 = int(w * 1ll * wlen % mod);
      }
    }
  }
  if (invert) {
    int nrev = bigmod(n, mod - 2);
    for (int i = 0; i < n; ++i) a[i] = int(a[i] * 1ll * nrev % mod);
  }
}
vector<int> multiply(const vector<int>& a, const vector<int>& b) {
  vector<int> res;
  vector<int> fa(a.begin(), a.end()), fb(b.begin(), b.end());
  size_t n = 1;
  while (n < max(a.size(), b.size())) n <<= 1;
  n <<= 1;
  fa.resize(n), fb.resize(n);
  fft(fa, false), fft(fb, false);
  for (size_t i = 0; i < n; ++i) fa[i] = ((long long)fa[i] * fb[i]) % mod;
  fft(fa, true);
  res.resize(n);
  for (size_t i = 0; i < n; ++i) res[i] = fa[i];
  while (res.size() * 2 > val + 2) res.pop_back();
  return res;
}
vector<int> unit_poly(int x) {
  vector<int> ret;
  for (int i = 0; i <= x; i++) ret.push_back(1);
  while (ret.size() * 2 > val + 2) ret.pop_back();
  return ret;
}
vector<int> F(int b, int e) {
  if (b == e) return unit_poly(v[b - 1]);
  int mid = (b + e) / 2;
  vector<int> l = F(b, mid);
  vector<int> r = F(mid + 1, e);
  return multiply(l, r);
}
long long solve() {
  vector<int> my = F(1, v.size());
  return my[val / 2];
}
int main() {
  int i, x, n;
  scanf("%d", &n);
  val = n;
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    cnt[x]++;
  }
  for (i = 1; i <= 3000000; i++)
    if (cnt[i]) v.push_back(cnt[i]);
  int k = v.size();
  sort(v.begin(), v.end());
  long long ret = solve();
  printf("%lld\n", ret);
  return 0;
}
