#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;
  long long int num[n];
  for (long long int i = 0; i < n; i++) {
    scanf(" %lld", &num[i]);
    if (!num[i]) {
      zero_flag = 1;
      break;
    }
  }

  if (zero_flag) {
    printf("0\n");
  } else {
    int over_flag = 0;
    long long int result = 1;
    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", (long long int) result);
  }

  return 0;
}
