#include <stdio.h>
int main(void){
	int N;
	long long int a [100000];
	long long int ans=1;
	int check = 0;  
    scanf("%d", &N);
  
    for (int i=0; i<N; i++){
    	scanf("%lld", &a[i]);
      
    	if (a[i] == 0){
            printf("0\n");
            check=1;
        }
        ans = ans * a[i];
      
    	if (ans >1000000000000000000){
    		printf("-1");
            check = 1;
            break;
        }
        
    }
    if (check == 0){
	    printf("%lld", ans);
    } 

    return 0;
}