const Main = input => {
    input = input.split("\n");
    const n = parseInt(input[0], 10);
    const arr = input[1].split(" ").map(value => parseInt(value, 10));

    let result = 1;
    for(let i = 0; i < n; i++) {
        if(arr.includes(0)) {
            result *= 0;
            break;
        }
        result *= arr[i];
        if(result > 10 ** 18) {
            result = -1;
            break;
        }
    }

    console.log(result);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));