#include <stdio.h>

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