#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-12;
const double PI = acos(-1.0);
const double angcst = PI / 180.0;
const long long mod = 998244353;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long qmul(long long a, long long b) {
  long long r = 0;
  while (b) {
    if (b & 1) r = (r + a) % mod;
    b >>= 1;
    a = (a + a) % mod;
  }
  return r;
}
long long qpow(long long a, long long n) {
  long long r = 1;
  while (n) {
    if (n & 1) r = (r * a) % mod;
    n >>= 1;
    a = (a * a) % mod;
  }
  return r;
}
long long qpow(long long a, long long n, long long p) {
  long long r = 1;
  while (n) {
    if (n & 1) r = (r * a) % p;
    n >>= 1;
    a = (a * a) % p;
  }
  return r;
}
const int N = 5000;
long long fac[N + 1], inv[N + 1];
void init() {
  fac[0] = 1;
  for (int i = 1; i <= N; i++) fac[i] = fac[i - 1] * i % mod;
  inv[N] = qpow(fac[N], mod - 2);
  for (int i = N - 1; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % mod;
}
long long A(long long m, long long n) { return fac[m] * inv[m - n] % mod; }
int a[5050], p[5050];
long long dp[5050];
void solve() {
  int n;
  cin >> n;
  for (int i = (1); i <= (n); i++) cin >> a[i];
  sort(a + 1, a + 1 + n);
  int pos = 0;
  p[0] = -1;
  for (int i = (1); i <= (n); i++) {
    while (2 * a[pos + 1] <= a[i]) pos++;
    p[i] = pos;
  }
  dp[0] = 1;
  for (int i = (1); i <= (n); i++)
    for (int j = (0); j <= (p[i]); j++)
      dp[i] = (dp[i] + dp[j] * A(n - 2 - p[j], p[i] - p[j] - 1)) % mod;
  if (a[n - 1] * 2 <= a[n])
    cout << dp[n] << '\n';
  else
    cout << 0 << '\n';
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  {
    init();
    solve();
  }
  return 0;
}
