#include <stdio.h>
#include <stdbool.h>
#include <limits.h>
int main()
{
  int n;
  scanf("%d",&n);
  unsigned long a[n];
  int i = 0;
  unsigned long ans = 1;
  bool minus = false;
  bool zero = false;
  unsigned long max = 0;
  while (i < n)
  {
    scanf("%lu",&a[i]);
    if (max < a[i])
      max = a[i];
    if (a[i] <= 1000000000000000000/ans)
    {
      ans *= a[i];
    }
    else if (a[i] == 0)
    {
      zero = true;
    }
	else
    {
      ans = 0;
      minus = true;
    }
    i++;
  }
  if (zero)
  {
    printf("0");
  }
  else if (minus || ans < max)
  {
    printf("-1");
  }
  else
  	printf("%lu",ans);
}