#include <stdio.h>

int main (void)
{
  long long int a[1000000],sum = 1;
  long long int n,i;
  
  scanf("%lld", &n);
  
  for(i = 0; i<n; i++){
    scanf("%lld",&a[i]);
    if(a[i]==0){
      sum = 0;
      break;
    }
  }
  
  for(i= 0; i<n;i++){
    sum = sum*a[i];
    if(sum > 1000000000000000000)
      break;
  }
  
  if(sum > 1000000000000000000|| sum < 0)
    sum = -1;
  
  printf("%lld", sum);
  
  return 0;
  
}
