"use strict";
const main = arg => {
    var input = arg.split('\n');
    var line = input.shift();
    var lines = input.shift().split(' ').map(Number);

    var answer = lines[0];

    for(let i = 1; i < line;i++){

        answer = answer * lines[i];
        if(answer > 1000000000000000000){
            console.log(-1);
            return;
        }
    }


    console.log(answer);


}

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