"use strict";
const main = arg => {
    var input = arg.split('\n');
    var line = input.shift().split(' ').map(Number);
    var lines = input.shift().split(' ').map(Number);

    var index = 1;
    var answer = lines[0];

    while(index !== lines.length){

        answer = answer * lines[index];
        if(answer > 1000000000000000000){
            answer = -1;
            break;
        }

        index++;
    }

    console.log(answer);


}

main(require("fs").readFileSync("/dev/stdin", "utf8"));