//ABC169_B
#include <stdio.h>
int main(){
	int n;
	long long int a[100005];
	long long int ans=1;
	
	scanf("%d",&n);
	
	for(int i=0;i<n;i++){
		scanf("%lld ",&a[i]);
//printf("a[%d]= %lld \t",i,a[i]);
		ans = ans * a[i];
//printf("%lld \n",ans);	
	}

	if(ans > 1000000000000000000 || ans <0){
		printf("-1");
	}
	else printf("%lld",ans);
	
	return 0;
}
