let N = Int(readLine()!)!
var numbers: [Int] = []
for _ in 0..<N {
    numbers.append(Int(readLine()!)!)
}
let result = numbers.reduce(0) { $0 * $1 }
if result > 10^18 {
    print(-1)
} else {
    print(result)
}