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.contains(0){
        print(0)
        return
    }
    for n in numbers {
        let x = ans &* n
        
        if x > Int.max || ans * n > 1000000000000000000{
            print(-1)
            return
        }

        ans *= n
    }
    print(ans)
}
main()
