#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
int n;
int a[5005], pos[5005];
long long dp[5005], f[5055], inv[5005];
void prework() {
  f[0] = 1;
  f[1] = 1;
  inv[1] = 1;
  inv[0] = 1;
  for (int i = 2; i <= n; i++) {
    f[i] = f[i - 1] * i % mod;
    inv[i] = (mod - mod / i) * inv[mod % i] % mod;
  }
  for (int i = 2; i <= n; i++) {
    inv[i] = inv[i] * inv[i - 1] % mod;
  }
}
long long A(long long a, long long b) { return f[a] * inv[a - b] % mod; }
int main() {
  cin >> n;
  prework();
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  int head = 0;
  for (int i = 1; i <= n; i++) {
    while (a[head + 1] * 2 <= a[i]) head++;
    pos[i] = head;
  }
  dp[0] = 1;
  pos[0] = -1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= pos[i]; j++) {
      dp[i] =
          (dp[i] + dp[j] * A(n - 2 - pos[j], pos[i] - pos[j] - 1) % mod) % mod;
    }
  }
  if (pos[n] == n - 1)
    cout << dp[n] << endl;
  else
    cout << 0 << endl;
  return 0;
}
