function main( args ) {
  const [N,_A] = args.trim().split('\n');
  const A = _A.split(' ').map(BigInt);
  if ( A.some(a=>!a) ) return console.log('0');
  let M = 1n;
  for ( let i = 0; i < N; i ++ ) {
    M *= A[i];
    if ( M > 1000000000000000000n ) return console.log('-1');
  }
  console.log(M.toString());
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));