#include<stdio.h>
int main(void){

	int N;
	long long int n = 1;
	long long int A[N];
	
	scanf("%d",&N);
	for(int i = 0;i < N;i++){
		scanf("%lld",&A[i]);
	}

	for(int i = 0;i < N;i++){
		n = n * A[i];
		if(i == N -1){
			if(n <= 1000000000000000000){
				printf("%lld\n",n);
			}else{ 
				printf("-1\n");
			}
		}
	}
	
	
	return 0;
}