open System.Numerics

let b0 = stdin.ReadLine() |> ignore
let b = stdin.ReadLine().Split(' ')

let fb: string [] -> BigInteger =
    let bigIntegerMultiply a b = BigInteger.Multiply(a, b)
    Array.map (int64 >> BigInteger)
    >> Array.fold (bigIntegerMultiply) 1I
    >> (fun x -> if x > 1000000000000000000I then -1I else x)

b |> fb |> printfn "%d"