#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define PI 3.141592653589793
#define MOD 1000000007

//qsort用、昇順
int compare_int(const void *a, const void *b)
{
	return *(int*)a-*(int*)b;
}
//qsort(data, 10, sizeof(int), compare_int)

long long int a[100100];

int main(){
	int n, f=0;
	scanf("%d", &n);
	for(int i=0; i<n; i++){
		scanf("%lld", &a[i]);
        if(a[i] == 0) f = 1;
	}

	long long int p = pow(10, 18);

	long long int ans = a[0];
	double l, m;
	for(int i=1; i<n; i++){
		l = log10(ans);
		m = log10(a[i]);
		if(l+m>18) {
			ans = -1; printf("yayaya\n");
			break;
		}
		ans *= a[i];
		
		if(ans>p){
			ans = -1; printf("nooooooooooo\n");
			break;
		}
		
	}
    if(f==1) ans = 0;

	printf("%lld\n", ans);
	
	return 0;
}