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

    //10^18は精度外なのでBigIntを使わないといけない
    let result = 1n;
    if(arr.includes(0)) {
        result = 0;
    } else {
        for(let i = 0; i < n; i++) {
            result *= BigInt(arr[i]);
            if(result > BigInt(10 ** 18)) {
                result = -1;
                break;
            }
        }
    }

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