#include <bits/stdc++.h>
using namespace std;
long long solve() {
  long long n;
  cin >> n;
  double d[n], m = 0, a, b, c;
  for (long long i = 0; i < n; i++) {
    cin >> d[i];
    m = max(m, d[i]);
  }
  if (m >= 0.5)
    cout << m;
  else {
    sort(d, d + n);
    long long i = n - 1;
    a = (d[i] * (1 - d[i - 1])) + (d[i - 1] * (1 - d[i]));
    c = (1 - d[i]) * (1 - d[i - 1]);
    for (long long i = n - 3; i >= 0; i--) {
      b = (d[i] * (c)) + (a * (1 - d[i]));
      c = c * (1 - d[i]);
      if (b < a)
        break;
      else
        a = b;
    }
    cout << setprecision(100) << a;
  }
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
}
