#include <stdio.h>
#include <math.h>
 
int main(){
  long long x=1, y;
  int s;
  scanf("%d", &s);
  for(int i=0; i<s; i++){
    scanf("%lld", &y);
    x*=y;
    if(y == 0){
      if(x > 1000000000000000000 || x < 0){
    	printf("-1\n");
    	return 0;
  		}
      printf("0\n");
      return 0;
    }
  }
  if(x > 1000000000000000000 || x < 0){
    printf("-1\n");
    return 0;
  }
  printf("%lld\n", x);
}