Problem: Let N be a positive odd number.

There are N coins, numbered 1, 2, \ldots, N. For each i (1 \leq i \leq N), when Coin i is tossed, it comes up heads with probability p_i and tails with probability 1 - p_i.

Taro has tossed all the N coins. Find the probability of having more heads than tails.

Constraints

* N is an odd number.
* 1 \leq N \leq 2999
* p_i is a real number and has two decimal places.
* 0 < p_i < 1

Input

Input is given from Standard Input in the following format:


N
p_1 p_2 \ldots p_N


Output

Print the probability of having more heads than tails. The output is considered correct when the absolute error is not greater than 10^{-9}.

Examples

Input

3
0.30 0.60 0.80


Output

0.612


Input

1
0.50


Output

0.5


Input

5
0.42 0.01 0.42 0.99 0.42


Output

0.3821815872

Solution (in JAVA):

Solution:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.util.*;
/**
 *
 * @author arvin
 */
public class Main {
 
    static double dp[][],a[];
    static int n;
    
    static double rec(int x,int y)
    {
        if((n&1)==1 && y>n/2)
            return 0.0;
         if((n&1)==0 && y>=n/2)
            return 0.0;
        if(x==n)
            return 1.0;
        if(dp[x][y]!=2.0)
            return dp[x][y];
        double ab,ch;
        if(dp[x+1][y]==2.0)
        {
            //System.out.print((x+1)+" "+y+" "+a[x]+" ");
            ab=a[x]*rec(x+1,y);
        }
        else
            ab=a[x]*dp[x+1][y];
        if(dp[x+1][y+1]==2.0)
            ch=(1-a[x])*rec(x+1,y+1);
        else
            ch=(1-a[x])*dp[x+1][y+1];
        dp[x][y]=ab+ch;
        //System.out.print(ab+" "+ch);
        return dp[x][y];
    }
    public static void main(String args[])
    {
        Scanner sc=new Scanner(System.in);
        n=sc.nextInt();
        dp=new double[n+1][n/2+5];
        a=new double[n];
        for(int i=0;i<=n;i++)
            Arrays.fill(dp[i],2.0);
        sc.nextLine();
        String abc[]=sc.nextLine().split(" ");
        for(int i=0;i<n;i++)
            a[i]=Double.parseDouble(abc[i]);
        System.out.println(rec(0,0));
        
        sc.close();
    }
}