#include <stdio.h>

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

  }
  /* code */
}
