#include <stdio.h>

int main () {
	int n;
	scanf("%d", &n);
	unsigned long long int a[n];
	unsigned long long sum = 1;
	for (int i = 0; i < n; i++){
		scanf("%llu", &a[i]);
		sum *= a[i];
	}
	if (sum > 1000000000000000000){
		printf("-1");
	}
	else {
		printf("%llu\n", sum);
	}
	
	return 0;
}