#include<stdio.h>
int main()
{
	int n,i;
	long a,t=1;

	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%ld",&a);
		t*=a;
	}
	if(t>1000000000000000000)
		printf("-1");
	else
		printf("%ld",t);
	return 0;
}