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

int main()
{
  	int n;
	int *a;
	long result;
  
  	result = 1;
  
  	scanf("%d",&n);
    a = (int*)malloc(sizeof(int)*n);
  
  	for(int i = 0; i < n; i++)
    {
      scanf("%d",&a[i]);
    }
  
  	for(int i = 0; i < n; i++)
    {
     	result *= (long)a[i];
    }
 	
  	if(result > 1000000000000000000)
  	{
      	result = -1;
    } 
	printf("%ld\n",result);
    return 0; 
}
