let memoize n f =
  let dp = Hashtbl.create n in
  let rec get x =
    try Hashtbl.find dp x with
    | Not_found ->
        let result = f get x in
        Hashtbl.add dp x result;
        result in
  get

let () = Scanf.scanf "%d\n" @@ fun n ->
  let ps = Array.init n @@ fun _ -> Scanf.scanf "%f " @@ fun p -> p in
  let dp = memoize (2 * n * n) @@ fun dp -> function
    | (0, 0) -> 1.
    | (0, _) -> 0.
    | (i, j) -> ps.(i - 1) *. dp (i - 1, j - 1) +. (1. -. ps.(i - 1)) *. dp (i - 1, j + 1) in
  Printf.printf "%.12f" @@ Array.fold_left ( +. ) 0. @@ Array.init (n + 1) @@ fun i -> dp (n, i)
