#include <bits/stdc++.h>
using namespace std;
const long long p = 998244353;
long long po(long long a, long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  if (b % 2 == 0) {
    long long u = po(a, b / 2);
    return (u * u) % p;
  } else {
    long long u = po(a, b - 1);
    return (a * u) % p;
  }
}
long long inv(long long x) { return po(x, p - 2); }
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long invm[n + 1];
  for (long long i = 1; i <= n; ++i) {
    invm[i] = inv(i);
  }
  long long a[n];
  for (long long i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  if (2 * a[n - 2] > a[n - 1]) {
    cout << 0;
    return 0;
  }
  long long dp[n];
  dp[0] = inv(n);
  for (long long i = 1; i < n; ++i) {
    dp[i] = 0;
    for (long long j = 0; j < i; ++j) {
      if (2 * a[j] <= a[i]) {
        dp[i] += (dp[j] * invm[n - 1 - (upper_bound(a, a + n, a[j] / 2) - a)]);
        dp[i] %= p;
      }
    }
    dp[i] += invm[n];
    dp[i] %= p;
  }
  long long ans = dp[n - 1];
  for (long long i = 1; i <= n; ++i) {
    ans *= i;
    ans %= p;
  }
  cout << ans;
  return 0;
}
