#include <bits/stdc++.h>
using namespace std;
mt19937 gen(chrono::system_clock::now().time_since_epoch().count());
const int N = 1e5 + 10;
const long long MOD = 1e9 + 7, MOD2 = 998244353;
const int rx[4] = {-1, 0, 1, 0};
const int ry[4] = {0, 1, 0, -1};
const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int hx[8] = {-2, -2, -1, 1, 2, 2, 1, -1};
const int hy[8] = {-1, 1, 2, 2, 1, -1, -2, -2};
const long double eps = 1e-7;
const double pi = acos(-1.0);
const long long INF = 2e9;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  vector<int> kol(n, 0), pos(n, -1);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      if (a[j] * 2 <= a[i]) kol[i]++;
    }
    for (int j = i + 1; j < n; j++) {
      if (a[j] >= a[i] * 2) {
        pos[i] = j;
        break;
      }
    }
  }
  vector<vector<long long> > dp(n, vector<long long>(n + 1, 0));
  vector<vector<long long> > sum(n, vector<long long>(n + 1, 0));
  for (int i = 0; i < n; i++) {
    dp[i][1] = 1;
  }
  vector<long long> pref(n + 1, 0);
  for (int i = 0; i < n; i++) {
    for (int j = 1; j < n; j++) {
      pref[j] += sum[i][j];
      pref[j] %= MOD2;
      dp[i][j] += pref[j];
      dp[i][j] %= MOD2;
      dp[i][j + 1] += (dp[i][j] * (kol[i] - (j - 1))) % MOD2;
      dp[i][j + 1] %= MOD2;
      if (pos[i] != -1) {
        sum[pos[i]][j + 1] += dp[i][j];
        sum[pos[i]][j + 1] %= MOD2;
      }
    }
    pref[n] += sum[i][n];
    pref[n] %= MOD2;
    dp[i][n] += pref[n];
    dp[i][n] %= MOD2;
  }
  long long res = 0;
  for (int i = 0; i < n; i++) res = (res + dp[i][n]) % MOD2;
  cout << res << '\n';
  return 0;
}
