"use strict";

const main = (input) => {
    const spi = input.split('\n');
    const n = spi[0];
    const a = spi[1].split(' ').map(e => BigInt(e));

    a.sort(function(a, b){
        return (a < b ? -1 : 1);
    });

    const MAX = 1000000000000000000n;
    let ans = a[0];
    for (let i = 1; i < n; i++) {
        ans *= a[i];
        if (ans > MAX) {
            console.log("-1");
            return ;
        }
    }

    console.log(ans);

};

main(require("fs").readFileSync("/dev/stdin", "utf8"));
