import Foundation

_ = readLine()
let ints = readLine()!.split(separator: " ").map { Decimal(string: String($0))! }
var r: Decimal = 1
if ints.contains(0) { r = 0 }
for i in ints {
    r *= i
    if r > 1_000_000_000_000_000_000 {
        r = -1
        break
    }
}
print(r)