#include <bits/stdc++.h>
    #include <ext/pb_ds/assoc_container.hpp>
    #include <ext/pb_ds/tree_policy.hpp>
     
    #define ll long long
    #define pb push_back
    #define mp make_pair
    #define f first
    #define s second
    #define sz(x) (int)x.size()
    #define all(x) x.begin(), x.end()
     
    using namespace std;
    using namespace __gnu_pbds;
     
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    template<class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>; ///find_by_order(),order_of_key()
    template<class T1, class T2> ostream& operator<<(ostream& os, const pair<T1,T2>& a) { os << '{' << a.f << ", " << a.s << '}'; return os; }
    template<class T> ostream& operator<<(ostream& os, const vector<T>& a){os << '{';for(int i=0;i<sz(a);i++){if(i>0&&i<sz(a))os << ", ";os << a[i];}os<<'}';return os;}
    template<class T> ostream& operator<<(ostream& os, const set<T>& a) {os << '{';int i=0;for(auto p:a){if(i>0&&i<sz(a))os << ", ";os << p;i++;}os << '}';return os;}
    template<class T> ostream& operator<<(ostream& os, const multiset<T>& a) {os << '{';int i=0;for(auto p:a){if(i>0&&i<sz(a))os << ", ";os << p;i++;}os << '}';return os;}
    template<class T1,class T2> ostream& operator<<(ostream& os, const map<T1,T2>& a) {os << '{';int i=0;for(auto p:a){if(i>0&&i<sz(a))os << ", ";os << p;i++;}os << '}';return os;}
    template<class T1,class T2> ostream& operator<<(ostream& os, const gp_hash_table<T1,T2>& a) {os << '{';int i=0;for(auto p:a){if(i>0&&i<sz(a))os << ", ";os << p;i++;}os << '}';return os;}
    
    double dp[3000+20][3000+20];
    double p[4000];
    int n;

    double nadji(int i, int j)
    {
        //cout << "e";
        if(dp[i][j] != -1)
        {
            //cout << "A" << endl;
            return dp[i][j];
        }
        if(i == 1 && j == 1)
        {
            //cout << "B" << endl;
            dp[i][j] = p[n-1];
            return p[n-1];
        }
        if(i == 1 && j == 0)
        {
            //cout << "C" << endl;
            dp[i][j] = 1-p[n-1];
            return 1-p[n-1];
        }
        if(j > i)
        {
            dp[i][j] = 0.0;
            //cout << "F" << endl;
            return 0.0;
        }
        

        dp[i][j] = nadji(i-1, j)*(1-p[n-i]) + nadji(i-1,j-1)*p[n-i];
        return dp[i][j];

    }

    int main()
    {
      ios_base::sync_with_stdio(false);
      cin.tie(NULL);

        
        
        cin >> n;
        for(int i =0; i<n; i++)
        {
            cin >> p[i];
        }
      
        for(int i =0; i<=n; i++)
        {
            for(int j =0; j <=n; j++)
                dp[i][j]=-1;
        }

        double rez = 0;

        for(int i = n; i > (n-i); i--)
        {
            //cout << "dp2"<< dp[n-1][i] << endl;
            double pom = nadji(n,i);
            rez+=pom;

            //cout << pom << endl;

        }

       // cout << "dp:" << endl;

        /*for(int i =0; i<n; i++)
        {
            for(int j =0; j <n; j++)
                cout << dp[i][j] << " ";
            cout << endl;
        }*/

        printf("%.10f\n",rez);

        return 0;
    }


Measured memory_bytes: 71296