import Foundation

let N = Int(readLine()!)!
let A = readLine()!.components(separatedBy: " ").map { Decimal(Int($0)!) }
var M = Decimal(1)

guard A.filter({ $0 == 0 }).count == 0 else {
    print(0)
    exit(EXIT_SUCCESS)
}

for i in 0..<N {
    M *= A[i]
    guard M <= pow(Decimal(10), 18) else {
        print(-1)
        exit(EXIT_SUCCESS)
    }
}
print(M)