#include <stdio.h>

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