#include <bits/stdc++.h>
using namespace std;
const int oo = (1 << 30);
vector<double> datap;
vector<double> datac;
int main() {
  int n;
  cin >> n;
  datap.assign(n, 0.0);
  datac.assign(n, 0.0);
  for (int i = 0; i < n; i++) cin >> datap[i];
  sort(datap.begin(), datap.end());
  reverse(datap.begin(), datap.end());
  for (int i = 0; i < n; i++) datac[i] = 1.0 - datap[i];
  double maxi = double(-oo);
  cout << fixed << setprecision(9);
  double sum = 0.0;
  double mul = 1.0;
  for (int i = 0; i < n; i++) {
    double p = datap[i];
    if (p == 1.0) {
      maxi = datap[i];
      break;
    }
    sum += p / datac[i];
    mul *= datac[i];
    maxi = max(maxi, sum * mul);
    if (sum > 1.0) break;
  }
  cout << maxi << '\n';
  return 0;
}
