import Foundation

let n = Int(readLine()!)!
let str = readLine()!

let words = str.components(separatedBy: " ")
var ans: UInt64 = 1
let max: UInt64 = 1000000000000000000
for i in 0..<n {
    let num = UInt64(words[i])!
    ans *= num
}

if ans > max {
    //print("\(ans) : \(max)")
    print("-1")
} else {
    print("\(ans)")
}

