#include <bits/stdc++.h>
using namespace std;
void boost() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
void solve() {
  int n;
  cin >> n;
  long double p[n];
  bool found = false;
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
    if (p[i] == 1) found = true;
  }
  if (found) {
    cout << 1 << endl;
    return;
  }
  sort(p, p + n);
  reverse(p, p + n);
  long double mx = p[0];
  long double P = p[0], x = (1.0 - p[0]);
  for (int i = 1; i < n; ++i) {
    if (p[i] == 0) break;
    P = (P * (1.0 - p[i])) + p[i] * x;
    x *= (1.0 - p[i]);
    mx = max(mx, P);
  }
  cout << fixed << setprecision(12);
  cout << mx << endl;
  return;
}
int main() {
  boost();
  int tc = 1;
  while (tc--) solve();
  return 0;
}
