_ = Int(readLine()!)!
var numbers = readLine()!.split(separator: " ").map({ Int($0)! })
if numbers.contains(0) {
    print(0)
} else {
    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)" )
}