function Main(input) {
	var str = input;
	var ans = 1;
	var count = 1;
	var str = str.split("\n");
	var a = str[1].split(" ");
	for(var i = 0;i<a.length;i++){
		a[i]=Number(a[i]);
		ans = ans/1000 *(a[i]/1000)*1000000;
		if(ans > 10**18){
			ans = -1;	
          break;
		}
    }

   console.log(ans);
   }
Main(require("fs").readFileSync("/dev/stdin", "utf8"));