#include<stdio.h>
int main() {
	int n;
	scanf("%d",&n);
	unsigned long long a[n];
	unsigned long long ans=1;
	for(int i=0;i<n;i++) {
		scanf("%lld",&a[i]);
		if(a[i]==0) ans=0;
	}
	if(ans) {
		for(int i=0;i<n;i++) {
			ans=ans*a[i];
			if(ans>1000000000000000000) break;
		}
	}
		
	if(ans>1000000000000000000) {
		printf("-1\n");
	}
	else printf("%lld\n",ans);
	return 0;
}