#include <stdio.h>

int main()
{
  long n;
  if (!(scanf("%ld",&n)))
    return (0);
  long i;
  i = 0;
  unsigned long a[n];
  unsigned long sum;
  sum = 1;
  while (i < n)
  {
    if (!(scanf("%lu",&a[i])))
        return 0;
    if (a[i] == 0)
    {
      printf("%d",0);
      return (0);
    }
    i++;
  }
  i = 0;
  while (i < n && sum <= 1000000000*1000000000)
  {
    sum *= a[i];
    i++;
  }
  if (sum <= 1000000000000000000)
    printf("%lu",sum);
  else
  	printf("%d",-1);
  
}