#include <stdio.h>

int main(void) {
  long long n,i;
  long long k=1,number[100000]={};
  scanf("%d",&n );

  for (i=0;i<n;i++) {
    scanf("%lld\n",&number[i]);
    /* code */
  }

  int r = 0;
  for (i=0;i<n;i++) {
    if (number[i]==0) {
      r++;
      /* code */
    }
    if (r>0) {
      printf("0\n");
      return(0);
      /* code */
    }
    /* code */
  }
  for (int i=0;i<n;i++ ) {
    if (number[i]<=1000000000000000000/k) {
      k *=number[i];
    }else{
      printf("-1\n");
      return (0);
    }
  }
  if (k>1000000000000000000) {
    printf("-1\n");
    return (0);
  }
  printf("%lld\n",k );
  return (0);
}
