import Foundation

func readInts() -> [Int] {
   return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let _ = Int(readLine()!)!
    let numbers = readInts()
    var ans = 1
    
    if numbers.firstIndex(of: 0) != nil{
        print(0)
        return
    }
    for n in numbers {
        ans *= n
        if ans > 1000000000000000000{
            print(-1)
            return
        }
    }
    print(ans)
}
main()
