function main(input) {
    var AA = input.split('\n')[1].split(' ').map((n) => parseInt(n, 10));
    var reducer = (a, b) => a * b;
    var answer = AA.reduce(reducer);
    if(answer > 1e18){
        console.log(-1)
    }else{
        console.log(answer)
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));