import Foundation

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

var ans = numList[0]

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

print(ans)