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

int main(void)
{
	int i, N, digit;
	long long int tmp, res;
	long long int *p;
	
	scanf("%d", &N);
	
	p = (long long int *)malloc(N);
	if(p == NULL){
		printf("memory error.");
		exit(EXIT_FAILURE);
	}
	
	for(i = 0; i < N; i++){
		scanf("%llu", &p[i]);
	}
 
	digit = 0;
	for(i = 0; i < N; i++){
		tmp = p[i];
		while(tmp > 1){
			tmp /= 10;
			digit++;
			if(digit >= 18){
				printf("-1");
                free(p);
				return 0;
            }
		}
	}
    
    res = 1;
    for(i = 0; i < N; i++){
      res *= p[i];
    }
  
	printf("%llu",res);
	free(p);
    
    return 0;
}