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