#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 >= 1000000000000000001){
            break;  
        }else{ ans = ans * b;
		}
    }
    if (ans <=1000000000000000001) {
      printf("%llu\n", ans);
    }else {printf("-1\n")
	}
	
    return 0;
}
