import Foundation


let N = Int(readLine()!)!
let AList:[Int] = readLine()!.components(separatedBy: " ").map { Int($0)! }

let result = AList.reduce(1) { $0 * $1 }

if result <= Int(pow(10.0, 18.0)) {
   print(result)
} else {
   print("-1")
}