#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

#define THREDTHOLD 1000000000000000000

int main(void) {
  long long int n;
  scanf("%lld", &n);

  int zero_flag = 0;
  int over_flag = 0;
  long long int num[n];
  for (long long int i = 0; i < n; i++) {
    scanf(" %lld", &num[i]);
    if (!num[i]) {
      zero_flag = 1;
    } else if (num[i] > THREDTHOLD) {
      over_flag = 1;
    }
  }

  if (zero_flag) {
    printf("0\n");
  } else {
    long long int result = 1;
    if (!over_flag) {
      for (long long int i = 0; i < n; i++) {
        result *= num[i];
        if (result > THREDTHOLD) {
          over_flag = 1;
          break;
        }
      }
    }

    if (over_flag) printf("-1\n");
    else printf("%lld\n", result);
  }

  return 0;
}
