int n;
int l[100000000000];
a=1000000000000000000;
scanf("%d",&n);
for(i=0;i<=n;i++){
  scanf("%d",&l[i]);
}
int c=1;
for(i=0;i<=n;i++){
  c*=l[i];
}
if(c>a){
  printf("-1\n");
}
else{
  printf("%d",c);
}
