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

int cmp(const void *a,const void *b){
    if(*(unsigned long long int*)a>*(unsigned long long int*)b){return -1;}
    else if(*(unsigned long long int*)a<*(unsigned long long int*)b){return 1;}
    else {return 0;}
}


int main(void){
int n;
double rog;
unsigned long long int sum;
unsigned long long int a[100005];
scanf("%d",&n);
for(int i=0;i<n;i++){
    scanf("%lld",&a[i]);
}
qsort(a,n,sizeof(unsigned long long int),cmp);

sum=a[0];
rog=log10(a[0]);
for(int i=1;i<n;i++){
    rog=rog+log10((double)a[i]);
    sum=sum*a[i];
    if(rog>18){printf("-1");return 0;}
    
}
//printf("%llf",rog);
printf("%lld",sum);
}
