#include <stdio.h>

int main(void){

  long n;
  scanf("%ld", &n);
  long a[n];
  for (long i = 0; i < n; i++) {
    scanf("%ld", &a[i]);
  }
  for (long i = 0; i < n; i++) {
    if (a[i] == 0) {
      printf("0\n");
      return 0;
    }
  }
  long ans = a[0];
  for (long i = 1; i < n; i++) {
    ans *= a[i];
    if (ans > 1000000000000000000) {
      printf("-1\n");
      return 0;
    }
  }
  printf("%ld\n", ans);

  return 0;
}