#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>

//1.000.000.000.000.000.000


int main (void) {
	int len, i = 0, number = 0;
	long long int product = 1, test;
	
	scanf("%d", &len);
	
	for (i = 0; i < len; i++) {
		scanf("%d", &number);
		if (number == 0) {
			printf("0\n");
			return 0;
		}
		product *= number;
		if (number<=1000000000000000000/product) {
			printf("-1\n");
			return 0;
		}
	}
	
	printf("%lli\n", product);
		
	return 0;
}