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

int main() {
	int n;
	long long int a[100000];
	long long int ans = 1;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lld", &(a[i]));
		ans *= a[i];
	}
	if (ans <= pow(10, 18.0)) {
		printf("%lld\n", ans);
	}
	else
	    printf("-1\n");

	return 0;
}