#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-10;
int main() {
  int n;
  double p1, p0, p[105];
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%lf", &p[i]);
  }
  sort(p, p + n);
  if (p[n - 1] - 0.5 > eps) {
    printf("%.12lf\n", p[n - 1]);
  } else {
    p1 = p[n - 1];
    p0 = 1.0 - p[n - 1];
    for (int i = n - 2; i >= 0; --i) {
      double tem = (1.0 - p[i]) * p1 + p0 * p[i];
      if (tem < p1) break;
      p1 = tem;
      p0 *= (1.0 - p[i]);
    }
    printf("%.12lf\n", p1);
  }
  return 0;
}
