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

//ABC169D

/*
 //ABC169C
 int main(void) {
 long long n, k, t;
 double b;
 scanf("%lld %lf", &n, &b);
 b=b*100;
 t=b;
 k=n*t;
 printf("%lld", k/100);
 return 0;
 }
 */

//ABC169B
int main(void) {
  long long n, k, i, cou, tmp=1;
  scanf("%lld", &n);
  long long a[n], num=1;

  for(i=0; i<n; i++){
    scanf(" %lld", &a[i]);
    if(a[i]==0){
      printf("0");
      return 0;
    }
  }
  for(i=0; i<n; i++){

    if(1e18/num<a[i]){
      printf("-1");
      return 0;
    }

    num*=a[i];

    if(num>1000000000000000000){
      printf("-1");
      return 0;
    }
  }
  printf("%lld", num);
  return 0;
}