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

void readInt(int *x) {
	scanf("%d", x);
	return;
}
void readInts(int n, int arr[]) {
	int i;
	for (i=0;i<n;i++) {
		readInt(&arr[i]);
	}
}
void readChar(char *x) {
	scanf("%c", x);
	return;
}
void readChars(char x[]) {
	scanf("%s", x);
	return;
}
void readString(char *x) {
	scanf("%s",x);
	return;
}
void printInts(int n, int *arr) {
	int i;
	for (i=0;i<n;i++) {
		printf("%d ", arr[i]);
	}
	printf("\n");
	return;
}
void swap(int *x, int *y) {
	int tmp;
	tmp = *x;
	*x = *y;
	*y = tmp;
	return;
}
void quicksort(int x[], int left, int right) {
	int i,j;
	int pivot;

	i = left;
	j = right;

	pivot = x[(left+right)/2];
	while (1) {
		while (x[i] < pivot) i++;
		while (pivot < x[j]) j--;
		if (i>=j) break;
		swap(&x[i],&x[j]);
		i++;
		j--;
	}
	if (left < i-1) quicksort(x, left, i-1);
	if (j+1 < right) quicksort(x, j+1, right);
}

int main(int argc, char const *argv[])
{
	int n;
	long long int a[10001];
	readInt(&n);
	int i;
	for(i=0;i<n;i++) {
		scanf("%lld", &a[i]);
	}

	int j;
	for(j=0;j<n;j++) {
		if (a[j]==0) {
			printf("0\n");
			return 0;
		}
	}

	long long int ans = 1;
	//printf("%lf %d\n", log10(a[1]), a[1]);

	for (i=0;i<n;i++) {
		printf("%lf\n", log10(ans)+log10(a[i]));
		if (log10(ans)+log10(a[i])>=18) {
			printf("-1 %lld\n", ans);
			return 0;
		}
		ans*=a[i];
	}

	printf("%lld\n", ans);

	return 0;
}