'use strict'
function main(inp) {
  inp = inp.trim().split('\n');
  let nums = inp[1].split(' ').map(x => x*1);
  let count = 0;
  let ans = 1;
  for(let i = 0; i < nums.length; i++){
    ans *= nums[i];
    if(nums[i] == 0){
    	ans = 0;
    } 
  }
  
  if(String(ans).length >= 18) {
    	ans = -1;
  }

  console.log(ans);
  
}

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