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

int main(int argc, char const *argv[]) {
  unsigned long long N;
  unsigned long long A;
  unsigned long long result = 1;

  scanf("%llu", &N);

  long double log_sum = 0;
  for (size_t i = 0; i < N; i++) {
    scanf("%llu", &A);
    log_sum += log10l(A);
    result *= A;
  }

  if (log_sum > 18.0 || result > 1000000000000000000) {
    printf("-1\n");
    return 0;
  }

  printf("%llu\n", result);
  return 0;
}
