#include <stdio.h>

int main(){
    
    int a;
    unsigned long long b;
    unsigned long long ans = 1;
    scanf("%d", &a);
    
    for(int i = 1 ; i <= a ; i++){
        scanf("%llu", &b);
        if(ans > 1000000000000000000){
            printf("-1\n");
			break;  
        }else{ ans = ans * b;
		}
    }
      printf("%llu\n", ans);

	
    return 0;
}
