#include<stdio.h>

int main()
{
	int n, a[100000],i;
	long long int b;

	scanf("%d", &n);
	for (i = 0;i <= n - 1;i++) {
		scanf("%d", &a[i]);
	}
	for (i = 0;i <= n - 1;i++) {
		b = b * a[i];
		if (b > 1000000000000000000) {
			printf("-1");
		}
	}
	printf("%lld", b);
	return 0;
}