process.stdin.resume();
process.stdin.setEncoding('utf8');
// Your code here!

"use strict";

const main = arg => {
    const input = arg.trim().split("\n");

    const N = input[0].split(" ").map(Number)[0];
    const K = input[1].split(" ").map(Number);
    
    const limit = Math.pow(10, 18);
    
    
    let multi = 1;
    let breakP = 0;
    for(let i = 0; i<N;i++){
        multi = multi * K[i];
    }
    if(multi > limit || multi == 1000000000000000000) {
        console.log(-1)
    } else {
     console.log(multi);   
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));  
