"use strict";

const main = arg => {
    const input = arg.trim().split("\n");
    const n = parseInt(input[0]);
    const arr = input[1].split(" ").map(item => parseInt(item));
    let digit = 0
    for (let item of arr) {
        if (item === 0) return 0
        digit = digit + item.toString().length-1
        if(digit > 18) return -1
    }
    let ret = 1
    for(let item of arr){
        ret = ret*item
    }
    console.log(ret)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));  