#include <stdio.h>
int main(){
  unsigned long i,n,a,result=1;
  int flag=0;
  
  scanf("%ld",&n);
  for(i=0;i<n;i++){
    scanf("%ld",&a);
    if(a==0){
      printf("%ld",a);
      return 0;
    } else {
      result*=a;
      if(result>1000000000000000000 || result<=0){
 //       printf("**%ld",result);
        result=-1;
        flag=1;
      }
    }
  }
  if(flag==1){
    printf("-1");
  } else {
    printf("%ld",result);
  }
}
