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

#define max 1000000000000000000

int main(){
	
	
	unsigned long long  N,A,sum=0,i,tmp;
	int ans=0;
	scanf("%llu",&N);
	int count=0;
	int sum_cnt=0;
	for(i=0;i<N;i++){
		scanf("%llu",&A);
		count=0;
		tmp=A;
		while(tmp>0){
			tmp=tmp/10;
			if(tmp>0)count++;
		}
		sum_cnt+=count;
		//printf("%d\n",sum_cnt);
		if(ans!=-1){
			if(i==0)sum=A;
			else sum*=A;
			if(sum_cnt>18){
				//printf("-1\n");
				ans=-1;
			}
		}
		if(A==0){
			printf("0\n");
			return 0;
		}
	}
	if(ans==-1 || sum>max )printf("-1\n");
	else printf("%llu\n",sum);

	return 0;
}
