#include <bits/stdc++.h>
using namespace std;
int n;
double p[202];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> p[i];
  sort(p, p + n);
  double ret = p[n - 1];
  if (ret >= 0.5) {
    printf("%.12lf\n", ret);
    return 0;
  }
  double p0 = 1 - p[n - 1], p1 = p[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    if (p0 >= p1) {
      p1 = p1 * (1 - p[i]) + p[i] * p0;
      p0 = p0 * (1 - p[i]);
    } else
      break;
  }
  printf("%.12lf\n", p1);
  return 0;
}
