const main = (input) => {
	const args = input.trim().split("\n");
	const N = args[0]
	const As = args[1].trim().split(" ")
	let flag = ''
	if (As.includes('0')) { flag = 'zero' }
	let answer = As[0]

	const limit = 10 ** 18
	if (flag !== 'zero') {
		let i = 1;
		while (i < As.length) {
			if (answer <= limit) {
				answer = BigInt(answer) * BigInt(As[i])
				i = (i + 1) | 0
				if (answer > limit) {
					flag = 'over'
					break
				}
			}
		}
	}
	switch (flag) {
		case 'zero' :
			console.log(0)
			break
		case 'over':
			console.log(-1)
			break
		default:
			console.log(answer.toString())
	}
}

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