    #include <stdio.h>
     
    int main(void) {
    	int N,i;
    	scanf("%d",&N);
    	unsigned long int b[1][N];
    	unsigned long int a;
    	a=1;
         for(i=0;i<N;i++){
           scanf("%lu",&b[1][i]);}
        for(i=0;i<N;i++){
           a=a*b[1][i]; 
        }
        if(a>=10000000000000000)
        {printf("-1");}else{printf("%lu",&a);}
     
    	return 0;
    }