_ = Int(readLine()!)!
var numbers = readLine()!.split(separator: " ").map({ Int($0)! })
let result = numbers.reduce(1) { $0 * $1 }
let limit = { () -> Int in
    var j = 1
    for _ in 1...18 {
        j *= 10
    }
    return j
}()
print((result >  limit) ? "-1" : "\(result)" )