#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const double PI = acos(-1.0);
const long long MAX = 1e13;
const long long N = 1e5 + 10;
int main() {
  long long n;
  cin >> n;
  double p[n];
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
  }
  sort(p, p + n);
  if (p[n - 1] == 1.0) {
    printf("%.12lf\n", p[n - 1]);
    return 0;
  }
  long long i = n - 1;
  double s = 0;
  double P = 1;
  double ans = 0;
  while (i >= 0 && s < 1) {
    ans += P * p[i] * (1 - s);
    s += p[i] / (1 - p[i]);
    P *= (1 - p[i]);
    i--;
  }
  printf("%.12lf\n", ans);
  return 0;
}
