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


int main() {
	int i, j, k;
	int m, n;
	long long int f = 1;
	int g = 0;
	int x[110] = {0};
	int a, b, c, d;


	scanf("%d", &n);

	for (i = 0;i < n;i++) {
		scanf("%d", &m);
		f = f * m;
		if (f > 1000000000000000000||f<0) {
			f = -1;
			break;
		}
	}

	printf("%lld", f);

	return 0;
}