#include <stdio.h>
int main(void){
	int n;
	long x = 1;
	int flg = 0;
	scanf("%d", &n);
	for(int i=0; i<n; i++){
		long a;
		scanf("%ld", &a);
		x *= a;
		if(x > 1000000000000000000 || x < 0){
			x = -1;
			flg = 1;
		}
	}
	if(flg == 0){
		printf("%ld\n", x);
	}
	else{
		printf("0\n");
	}
	return 0;
}