#include <stdio.h>
#include <stdlib.h>

typedef unsigned long long ull;

int compare_ints(const void* a, const void* b)
{
    ull arg1 = *(const int*)a;
    ull arg2 = *(const int*)b;
 
    if (arg1 < arg2) return -1;
    if (arg1 > arg2) return 1;
    return 0;
}

int	main(void)
{
  	ull	n;
  	ull	a[100002];
 	ull	i;
  	ull	m;
  
  	scanf("%llu\n", &n);
  	for(i=0ULL; i<n; i++)
    { 
      	scanf("%llu", &a[i]);
      	if (a[i] == 0ULL)
      	{
      	    printf("0");
      	    return (0);
      	}
    }
    
    qsort(a, n, sizeof(ull), compare_ints);

    m = 1ULL;
    for(i=0ULL; i<n; i++)
    {
        if (a[i] > 1000000000000000000ULL / m)
        {
            printf("-1");
            return (0);
        }
      	m = m * a[i];
      	if (m > 1000000000000000000ULL)
        {
          	printf("-1");
          	return (0);
        }
    }
  	
  	printf("%llu", m);
  	return (0);
}