#include<stdio.h>
#include<stdint.h>
#include<inttypes.h>
#include<stdlib.h>
int compare(uint64_t*a,uint64_t*b){
  return *a<*b?-1:*a==*b?0:1;
}
int main(){
  int n;
  scanf("%d",&n);
  uint64_t a[n];
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
    if(a[i]==0)puts("0"),exit(0);
  }
  qsort(a,n,sizeof(uint64_t),compare);
  uint64_t sum=1;
  for(int i=0;i<n;i++)if((sum*=a[n])>1000000000000000000)puts("-1"),exit(0);
  printf("%" PRIu64 "\n",sum),exit(0);
}
