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