import Foundation

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

if numList.filter({ $0 == 0 }).count == 0 {

    var ans = numList[0]

    for i in 1..<N {
        ans = ans * numList[i]
//        if Decimal(ans) > pow(10,18) {
        if ans > 1000000000000000000 {
            ans = -1
            break
        }
    }
    print(ans)
} else {
    print (0)
}