#include<stdio.h>
int main()	
{
	int tc;
	scanf("%d",&tc);
	long long input[tc+1];
	long long total = 1;
	for(int i = 0;i<tc;i++)
	{
		scanf("%lld",&input[i]);
		total *= input[i];
	}
	total > 1000000000000000000 ? printf("-1\n") : printf("%lld",total);
	return 0;
}