#include <stdio.h>

int main(){
	long long int n, perkalian;
	int x, i;
	char a[]="-1";
	
	scanf("%d", &x);
	
	for(i=0; i<x; i++){
		scanf("%d", &n);	
		perkalian=perkalian*n;
	}
	if (perkalian>1000000000000000000){
		printf("%s", a);
	}
	else {
		printf("%lld", perkalian);
	}
	
	return 0;
}