#include <stdio.h>
#define SIZE 100000
int main() {
	int n,i;
	unsigned long long int a[SIZE],multi=1,digit=0,r;
	scanf("%d",&n);
	for(i=0;i<n;i++){
	    scanf("%llu",&a[i]);
	    multi *= a[i];
	    while(a[i]!=0){
	        r=a[i]%100;
	        a[i]/100;
	        digit++;
	        if(digit>16){
	            break;
	        }
	    }
	}
	if(digit<=18){
	    printf("%llu\n",multi);
	}
	else{
	    printf("-1\n");
	}

	return 0;
}