#include <bits/stdc++.h>
using namespace std;
template <class C>
void mini(C& a, C b) {
  a = min(a, b);
}
template <class C>
void maxi(C& a, C b) {
  a = max(a, b);
}
void a() {
  int l, r;
  cin >> l >> r;
  if (r < 2 * l)
    cout << "YES\n";
  else
    cout << "NO\n";
}
void b() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int res = 0;
  for (int(i) = 1; i <= n - 1; i++)
    if (s[i] == s[i - 1]) res++;
  res++;
  res /= 2;
  cout << res << '\n';
}
void c() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  vector<vector<int> > dp(n + 1, vector<int>(2 * n));
  for (int(i) = 1; i <= n; i++) {
    for (int j = 0; j < 2 * n; j++) {
      dp[i][j] = 1e9;
      for (int jp = 0; jp < j; jp++) {
        mini(dp[i][j], dp[i - 1][jp] + abs((jp + 1) - a[i - 1]));
      }
    }
  }
  cout << dp[n][2 * n - 1] << '\n';
}
int prof(vector<vector<int> >& g, int nodo) {
  if (g[nodo].empty()) return 0;
  int res = 1;
  for (auto hijo : g[nodo]) maxi(res, prof(g, hijo) + 1);
  return res;
}
void d() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<vector<int> > g(n + 1);
  g[1].push_back(a[1]);
  int p = 0;
  int i = 2;
  while (i < n) {
    while (i < n and a[i] > a[i - 1]) {
      g[a[p]].push_back(a[i]);
      i++;
    }
    p++;
    if (i < n) g[a[p]].push_back(a[i]);
    i++;
  }
  int res = prof(g, 1);
  cout << res << '\n';
}
int bb(vector<int>& v, int x) {
  int hi = v.size() - 1;
  int lo = 0;
  while (lo + 1 != hi) {
    int m = (lo + hi) / 2;
    if (x < v[m])
      hi = m;
    else
      lo = m;
  }
  return hi;
}
int lis(vector<int>& a, int l, int r) {
  int res = 0;
  vector<int> coso;
  for (int i = l + 1; i <= r - 1; i++) {
    if (a[i] < a[l])
      res++;
    else if (a[i] > a[r])
      res++;
    else
      coso.push_back(a[i]);
  }
  int n = coso.size();
  vector<int> dp(n + 1, 1e9);
  dp[0] = -1e9;
  for (int i = 0; i < n; i++) {
    int j = bb(dp, coso[i]);
    dp[j] = coso[i];
  }
  int llis = 0;
  for (int(i) = 1; i <= n; i++)
    if (dp[i] != 1e9) llis = i;
  return r - l - 1 - llis;
}
void e() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n + 2);
  for (int(i) = 1; i <= n; i++) cin >> a[i];
  a[0] = -1e9;
  for (int(i) = 1; i <= n; i++) a[i] -= i;
  a[n + 1] = 1e9 + 10;
  vector<int> b(k + 2);
  for (int(i) = 1; i <= k; i++) cin >> b[i];
  b[0] = 0;
  b[k + 1] = n + 1;
  for (int i = 0; i < k + 1; i++) {
    if (a[b[i + 1]] < a[b[i]]) {
      cout << "-1\n";
      return;
    }
  }
  int res = 0;
  for (int i = 0; i < k + 1; i++) {
    res += lis(a, b[i], b[i + 1]);
  }
  cout << res << '\n';
}
void f() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  vector<int> opciones(n);
  for (int(i) = 1; i <= n - 1; i++) {
    opciones[i] = opciones[i - 1];
    while (a[opciones[i]] * 2 <= a[i]) opciones[i]++;
  }
  vector<long long> dpp(n, 1);
  vector<long long> dp(n);
  int len = 1;
  while (len < n) {
    for (int i = 0; i < n; i++) {
      if (opciones[i] >= len)
        dp[i] = (dpp[i] * (opciones[i] - len + 1)) % 998244353;
      else
        dp[i] = 0;
    }
    for (int(i) = 1; i <= n - 1; i++)
      dpp[i] = (dpp[i] + dpp[i - 1]) % 998244353;
    for (int i = 0; i < n; i++) {
      if (opciones[i] == 0) continue;
      dp[i] += dpp[opciones[i] - 1];
      dp[i] %= 998244353;
    }
    dpp = dp;
    len++;
  }
  long long res = 0;
  for (int i = 0; i < n; i++) {
    res += dpp[i];
    res %= 998244353;
  }
  cout << res << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  f();
  return 0;
}
