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;
const int P = 998244353, G = 3, Gi = 332748118;
const int N = 1 << 18, M = 3e6 + 1;
int fpow(int x, int p) {
  int rs = 1;
  while (p) {
    if (p & 1LL) rs = 1LL * rs * x % P;
    x = 1LL * x * x % P;
    p >>= 1;
  }
  return rs;
}
int t[N];
void NTT(vector<int> &A, int limit, int opt) {
  for (int i = 0; i < limit; i++)
    if (i < t[i]) swap(A[i], A[t[i]]);
  for (int i = 1; i < limit; i <<= 1) {
    int wn = fpow((opt == 1) ? G : Gi, (P - 1) / (i << 1));
    for (int p = i << 1, j = 0; j < limit; j += p) {
      int w = 1;
      for (int k = 0; k < i; k++, w = 1LL * w * wn % P) {
        int x = A[j + k], y = 1LL * w * A[j + i + k] % P;
        A[j + k] = (x + y) % P;
        A[j + i + k] = (x - y + P) % P;
      }
    }
  }
}
struct Node {
  int x, n;
  Node(int _x = 0, int _n = 0) {
    x = _x;
    n = _n;
  }
};
bool operator<(Node a, Node b) { return a.n > b.n; }
void merge(vector<int> &a, vector<int> &b) {
  int limit = 1, k = 0;
  while (limit <= a.size() + b.size() - 2) limit <<= 1, k++;
  for (int i = 0; i < limit; ++i)
    t[i] = (t[i >> 1] >> 1) | ((i & 1) << (k - 1));
  while (a.size() < limit) a.push_back(0);
  while (b.size() < limit) b.push_back(0);
  NTT(a, limit, 1);
  NTT(b, limit, 1);
  for (int i = 0; i < limit; ++i) a[i] = 1LL * a[i] * b[i] % P;
  NTT(a, limit, -1);
  limit = fpow(limit, P - 2);
  for (int i = 0; i < a.size(); ++i) a[i] = 1LL * a[i] * limit % P;
  while (!a[a.size() - 1]) a.pop_back();
}
vector<int> g[M];
int c[M], p, n;
priority_queue<Node> Q;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &p);
    c[p]++;
  }
  for (int i = 2; i < M; ++i) {
    if (!c[i]) continue;
    for (int j = 0; j <= c[i]; ++j) g[i].push_back(1);
    Q.push(Node(i, c[i]));
  }
  Node a, b;
  while (Q.size() > 1) {
    a = Q.top();
    Q.pop();
    b = Q.top();
    Q.pop();
    merge(g[a.x], g[b.x]);
    a.n += b.n;
    Q.push(a);
  }
  a = Q.top();
  printf("%d\n", g[a.x][n / 2]);
}
