#include <stdio.h>

int main () 
{
	long long int hasil = 1;
	long long int banyak = 1000000000000000000;
	long long int c[200000];
	int a; int nol = 0 ; int min = -1;
	
	scanf ("%d", &a);
	 
	for (int i = 0; i<a ; i++){
		scanf ("%lld", &c[i]);	
		if (c[i]>=banyak) {
			printf ("-1\n");
			return 0;
		}
		hasil = hasil * c[i];
	}
	
	if (hasil == 0) {
		printf ("%d",nol);
	}	 	
	
	else if (hasil>banyak || hasil < 0){
		printf ("%d\n", min);
	}
	
	else if (0 < hasil <= banyak){
		printf ("%lld", hasil);
	}
	
	return 0;

}