{-# LANGUAGE BangPatterns      #-}

import Prelude as P
import Data.List
import Data.Vector.Unboxed as V hiding(sum,forM,forM_,map)
import Data.Array.Unboxed  as A
import Data.Array.MArray
import Data.Array.ST
import Control.Monad
import Control.Monad.ST
import Debug.Trace

type P = Vector Double
type DP s = STUArray s (Int,Int) Double

setArr :: DP s -> P -> Int -> ST s ()
setArr dparr ps n = do
  let ps' i = ps V.! (i-1)
      fb i = (ps' i)+(ps' (i-1)) - 2*(ps' i)*(ps' (i-1))
      bb i = 1-(ps' i)-(ps' (i-1)) + (ps' i)*(ps' (i-1))
  forM_ [1..n] $ \i -> writeArray dparr (0,i) $ (V.scanl (\x y -> x*(1-y)) 1 ps) V.! i
  forM_ [1..div (n-1) 2] $ \i -> do
    if i /= 1 then writeArray dparr (i,i-1) $ (V.scanl (\x y -> x*y) 1 ps) V.! i else return ()
    writeArray dparr (i,i)   $ (V.scanl (\x y -> x*y) 1 ps) V.! i
  forM_ [3,5..n] $ \i -> do
     e0 <- readArray dparr (0,i-2)
     e1 <- readArray dparr (1,i-2)
     writeArray dparr (1,i) $ e1*(bb i) + e0*(fb i)

dp_i :: DP s -> P -> Int -> Int -> ST s ()
dp_i dparr ps k i = do
  let ps' i = ps V.! (i-1)
      ff i = (ps' i)* (ps' (i-1))
      fb i = (ps' i)+(ps' (i-1)) - 2*(ps' i)*(ps' (i-1))
      bb i =  1-(ps' i)-(ps' (i-1)) + (ps' i)*(ps' (i-1))
  traceShow ("dp_i start",k,i) $ return ()
  ek  <- readArray dparr (k,i-2)
  ek1 <- readArray dparr (k-1,i-2)
  ek2 <- readArray dparr (k-2,i-2)
  traceShow ("dp_i ps = ",ps,ps' i,ff i,fb i,bb i) $ return ()
  writeArray dparr (k,i) $ traceShowId $ (ek*(bb i)) + (ek1*(fb i)) + (ek2*(ff i))
  traceShow ("dp_i goal",ek,ek1,ek2) $ return ()

solve :: P -> Int -> ST s Double
solve ps n = do
  dparr <- newArray ((0,1),(div (n-1) 2,n)) 0
  setArr dparr ps n
  forM_ [2..div (n-1) 2] $ \k -> if k `mod` 2 == 0
    then forM_ [k+1,k+3..n] $ \i -> dp_i dparr ps k i
    else forM_ [k+2,k+4..n] $ \i -> dp_i dparr ps k i
  ans0 <- forM [0..div (n-1) 2] $ \k -> readArray dparr (k,n)
  return $ traceShow ans0 $ 1-(sum ans0)

main :: IO ()
main = do
  n <- read <$> getLine
  ps <- map read.words <$> getLine
  putStrLn $ show $ runST $ solve (V.fromList ps)  n

mod0 :: Int -> Int
mod0 n = mod n 1000000007
