#include<stdio.h>
signed main(){
 
long long i,n,answer=1;
 
scanf("%lld",&n);
int a[n]; 
 
for(i=0;i<n;i++){
 
scanf("%lld",&a[i]);
answer*=a[i];
}
if(answer<=1000000000000000000){
printf("%lld\n",answer);
}else{
printf("-1\n");    
}
 
 
 
return(0);
}