#include<stdio.h>
#define ll long long
ll  max =  1000000000000000000;
int main(){
	ll n,temp,sum=1;
	scanf("%lld",&n);
	for(int i = 0;i<n;i++){
		scanf("%lld",&temp);
		sum *= temp;
	}
	sum>max? printf("-1"):printf("%lld",sum);
}