#include <stdio.h>
int main() {
	int n;
	scanf("%d", &n);
	long long int arr[n], max = 1e18, aaa = 1, bbb = 0, ccc = 0;
	
	for (int i = 0; i < n; i++){
		scanf("&lld", &abc[i]);
		bbb = (arr[i] > max) ? 1 : bbb;
		aaa *= arr[i];
		(arr[i]) ? max /= arr[i] : ccc = 1;
	}
	(ccc) ? puts("0") : ((bbb) ? puts("-1") : printf("%lld\n", aaa));
	
	return 0;
}