int main(){
  int num, i, j;
  int cnt = 0;
  long int* a;
  long int b;
  long int ans = 1;
  
  scanf("%d", &num);
  a = (int *)malloc(sizeof(long int)*num);
  
  for(i = 0; i < num; i++){
    scanf("%ld ", &a[i]);
    b = a[i];
    if(a[i] == 0){
      ans = 0;
      break;
    }
    while(b >= 10) {
      b /= 10;
      cnt++;
    }
  }

  if(ans == 0)
  {
    printf("%ld", ans);
  }
  else if(cnt > 18) {
    printf("%d", -1);
  }
  else
  {
    for(i = 0; i < num ; i++){
      ans *= a[i];
    }
    printf("%ld", ans);
  }
  
  return 0;
}