function main(input) {
    let args = input.split('\n');
    let A = args[1].split(' ').map((n) => parseInt(n, 10));
    const reducer = (accumulator, currentValue) => accumulator * currentValue;
    let answer = A.reduce(reducer);
    if(answer > 100000000000000000){
        console.log(-1)
    }else{
        console.log(answer)
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));