function Main(arg) {
    var arg = arg.trim().split('\n');
    var n = Number(arg[0]);
    var aList = arg[1].split(' ');
    
    if(aList.includes('0')){
        console.log(0);
        return;
    }
    var ret = 0;
    for (key in aList) {
        a = BigInt(aList[key]);
        if(a > 1000000000000000000){
            console.log(-1);
            return;
        }
        if (ret == 0){
            ret = a;
        } else {
            ret = ret * a;
        }
        if(ret > 1000000000000000000){
            console.log(-1);
            return;
        }
    }
    console.log(ret.toString());
    return;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
