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

#define rep(i,k,n) for(int (i)=(k);(i)<(n);(i)++)
#define max(a,b) (a)>(b)?(a):(b)
#define min(a,b) (a)<(b)?(a):(b)
#define abs(a) (a)>0 ?(a):-(a)
#define llong long long

int main(){
	int N; scanf("%d",&N);
	llong ans=1;
	rep(i,0,N){
		llong a; scanf("%lld",&a);
		if( a==0 ){
			printf("0");
			return 0;
		}
		if( ans > 1000000000000000000/a ){
			rep(j,i+1,N){
				llong b; scanf("%lld",&b);
				if( b==0 ){
					printf("0");
					return 0;
				}
			}
			printf("-1");
			return 0;
		}
		ans *= a;
	}
	printf("%lld",ans);
	return 0;
}
