function Main(input) {
  	input = input.split("\n");
  	const num = input[1].split(" ");
    if (num.filter(a => a === '0').length > 0){
        console.log(0);
    } else {
        let sum = 1;
      	let len = 0;
        num.sort(function(a,b){
            return b-a;
        });
        for(var i = 0; i < num.length; i++){
        	sum *= Number(num[i]);
          	len += num[i].length;
            if(len >= 18){
            	break;
            }
        }
    console.log(len >= 18 && sum != Math.pow(10, 18) ? -1 : sum);
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));