// Learn more about F# at http://fsharp.org

open System

[<EntryPoint>]
let main argv =
  let N = Console.ReadLine() |> int
  let ans =
    Console.ReadLine().Split([|' '|]) 
    |> Array.map bigint.Parse
    |> Array.fold (*) bigint.One
  if ans > bigint.Pow(bigint 10, 18) then "-1" else ans.ToString()
  |> Console.WriteLine
  0 // return an integer exit code
