import Foundation

let N = Int(readLine()!)!
let strA = readLine()!.components(separatedBy: " ")

guard strA.filter({ $0 == "0" }).count == 0 else {
    print(-1)
    exit(EXIT_SUCCESS)
}

let A = strA.map { Double($0)! }
var M = Double(1)
var length = 0
for i in 0..<N {
    guard String(M).count + String(A[i]).count - 1 < 18 else {
        print(-1)
        exit(EXIT_SUCCESS)
    }
    M *= A[i]
}
print(M)
