#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define Rep(i,l,r)for(int i=(int)l;i<(int)r;i++)
#define rep(i,n)Rep(i,0,n)
typedef long long lld;
typedef long double Lf;
#define Ma(x,y) ((x)>(y)?(x):(y))
#define mi(x,y) ((x)<(y)?(x):(y))
#define N 100001

int main() {
	lld a[N],n,flag0=0,ans=1;
	Lf dig = 0;
	scanf("%lld", &n);
	rep(i, n) { scanf("%lld", &a[i]); if (!a[i])flag0++; }
	if (flag0)ans=0;
	else {
		rep(i,n)dig+=log10l((Lf)a[i]);
		if (dig > 18.5)ans = -1;
		else rep(i, n)ans *= a[i];
	}
	printf("%lld", (ans > (lld)1e18 ? -1 : ans));
}