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

int main(void) {
  int n;
  int i;

  unsigned long long int r = 1;

  scanf("%d", &n);

  for (i = 0; i < n; i++) {
    unsigned long long int a;
    scanf("%llu", &a);
    r *= a;
    if (r >= 1000000000000000000ull) {
      printf("-1\n");
      return 0;
    }
  }
  printf("%llu\n", r);
  return 0;
}
