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




int main(void){
int n;
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]);
}
//printf("%lld",1000000000000000000*1000000000000000000);
sum=a[0];
for(int i=1;i<n;i++){
    sum=sum*a[i];
    if(sum<0){printf("-1");return 0;}
}
printf("%lld",sum);
}
