open Scanf
open Printf
open Big_int

let multiplication lst =
  let ans = List.fold_right mult_big_int lst (big_int_of_int 1) in
    if gt_big_int ans (big_int_of_int 1000000000000000000) then -1 else int_of_big_int ans

let n = sscanf (read_line ()) "%d" (fun n -> n)
let a_list = List.map (fun n -> big_int_of_string n) (String.split_on_char ' ' (read_line ()))
let () = printf "%d\n" (multiplication a_list)