"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const A = arg[1].split(" ").map(n=>BigInt(n));
    
    let answer = 1n;

    if(A.filter(n=>n===0n).length !== 0) {
        console.log(0);
        return;
    }
    
    for(let i in A) {
        answer *= A[i];
        
        if(answer > 1000000000000000000n) {
            console.log(-1);
            return;
        }
    }
    
    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));