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


int main(void){
int n;
double max=1000000000000000000;
long long int sum;
long long int a[100005];
scanf("%d",&n);
for(int i=0;i<n;i++){
    scanf("%lld",&a[i]);
    if(a[i]==0){printf("-1");return 0;}
}

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