#include <stdio.h>
int main(void){
  unsigned long long int m=1;
  int num,i;
  int data[100000];
  scanf("%d",&num); 
 

for (i=0;i < num;i++){ 
    scanf("%d",&data[i]); 
}
  for(i=0;i<num;++i){
    m=m*data[i];
  }
  if(m<=1000000000000000000){
    printf("%lld",m);
  }
  else{
    printf("-1");
  }
  return 0;
}
