#include <stdio.h>
#define SIZE 100000
int main() {
	int n,i;
	long long int a[SIZE],multi=1;
	scanf("%d",&n);
	for(i=0;i<n;i++){
	    scanf("%lld",&a[i]);
	    multi *= a[i]; 
	}
	if(multi<=1000000000000000000){
	        printf("%lld\n",multi);
	}
	else{
	    printf("-1\n");
	}
	return 0;
}