#include<stdio.h>
#include<stdlib.h>
#include<math.h>

typedef long long ll;

int main(void){

	ll a[100000],b,result=1;
    int n,i;
    scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%lld",&a[i]);
  }
  for(i=0;i<n;i++){
  	if(powl(10,18)/result<a[i]){
    	result = -1;
    	break;
  	}else if(a[i]==0){
    	result = 0;
    	break;
  	}
    result *= a[i];
  }
  printf("%lld", result);
    
    return 0;
}