#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

#define PI 3.141592653589793

/*double rad(double x)
{
	x* PI / 180.0;
};*/


int main()
{
	int n;
	long long int a, sum = 1;
	int flg = 0;

	if (scanf("%d", &n) == 1)
	{

		for (int i = 0; i < n; i++)
		{
			if (scanf("%lld", &a) == 1)
			{
				sum *= a;
			}

		}
		if (sum > 1000000000000000000)
		{
			printf("%d\n", -1);
		}

		else
		{
			printf("%lld\n", sum);
		}
	}

	return 0;
}



/*int main()
{
	double a;
	float b,sum;
	//int sum2;

	scanf("%lf%f", &a, &b);
	//a = a / 1000000000000000;
	printf("%lf\n%f\n", a,b);
	
	printf("%lf\n", (double)b*a);
	//sum = a* b;
	printf("%lld\n", floor(a*b));
	return 0;
}

*/