let N = Int(readLine()!)!

func solveB(array: [Int]) -> Int? {
    guard array.first(where: { $0 == 0 }) == nil else { return 0 }
    var result = 1
    for a in array {
        let (partialValue, overflow) = result.multipliedReportingOverflow(by: a)
        if overflow || partialValue > 1_000_000_000_000_000_000 {
            return nil
        } else {
            result = partialValue
        }
    }

    return result
}

print(solveB(array: readLine()!.split(separator: " ").map { Int($0)! }) ?? "-1")
