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

int main(void) {
  long n,k,q,number[100000];
  double r;
  scanf("%ld",&n );
  for (int i=0;i<n;i++ ) {
    scanf("%ld",&number[i]);
    /* code */
  }
  k = number[0];
  for (int c=1;c<n;c++) {
    k *= number[c];
    /* code */
  }
  r = pow(10.0,18.0);
  q = (long)r;
  if (k>q) {
    printf("%d\n",-1 );
    return 0;
    /* code */
  }else{
    printf("%ld\n",k );
    return 0;

  }
  /* code */
}
