#include <stdio.h>
#include <math.h>
int main(void)
{
  int n, i;
  scanf("%d", &n);
  long long a[n];
  long long tmp = powl(10, 18);
  long long sum = 1;
  int flg1 = 0, flg2 = 0;
  for (i = 0; i < n; i++)
  {
    scanf("%lld", &a[i]);
    if (a[i] > tmp)
      flg1 = 1;
    if (a[i] == 0)
      flg2 = 1;
    sum = sum * a[i];
  }
  if (sum > tmp || (flg1 == 1 && flg2 == 0))
  {
    printf("-1");
    return 0;
  }
  printf("%lld", sum);
  return 0;
}
