"use strict";

const main = arg => {
    const inputList = arg.trim().split("\n");
    // 回答を記述
    const N = BigInt(inputList[0].split(" ")[0]);
    const AList = inputList[1].split(" ");

    if (AList.some(ele => ele == 0)) {
        console.log(0);
    } else {
        let num = 1n;
        for (let i = 0; i < AList.length; i++) {
            num *= BigInt(AList[i]);
            if (num > 10n ** 18n) {
                num = -1n;
                break;
            }
        }

        console.log(BigInt.asIntN(64, num).toString())
    }
}

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