#include<stdio.h>
int main(){
int a,b,c[1000000],d,e;
  e=1;
  scanf("%d",&a);
  for(b=1;b<=a;b++) scanf("%d",&c[b]);
  for(b=1;b<=a;b++){
    e=e*c[b];
  }
  if(e>1000000000000000000) e=-1;
  printf("%d",e);
return 0;
}