#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const int MOD = 1e9 + 7;
const int MAXBIT = 31;
double p[MAXN];
long long int n;
double solve() {
  sort(p, p + n);
  if (p[n - 1] == 1.0) {
    return 1.0;
  }
  double cp = 1.0;
  double cs = 0.0;
  for (int i = n - 1; i >= 0; --i) {
    cs += p[i] / (1.0 - p[i]);
    cp *= (1.0 - p[i]);
    if (cs >= 1.0) {
      break;
    }
  }
  return cs * cp;
}
int main(int argc, const char* argv[]) {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
  }
  cout << fixed << setprecision(12) << solve() << endl;
  return 0;
}
