"use strict";
var input = require("fs").readFileSync("/dev/stdin", "utf8");
var cin = input.trim().split(/ |\n/), cid = 0;

console.log(main());

function main() {
    var n = +cin.shift();
    if (cin.indexOf('0') >= 0) return 0;
    let ans = 1n;
    let max = BigInt(10) ** BigInt(18);
    for (let i = 0; i < n; i++) {
        ans = ans * BigInt(cin.shift());
        if (ans > max) return -1;
    }
    return ans.toString();
}