#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <math.h>
typedef char Bool;
#define true 39
#define false 0
typedef long long int64;
typedef unsigned long long uint64;
typedef int int32;
typedef unsigned int uint32;
typedef unsigned char byte;
#define OVER 1000000000000000000‬

Bool primeche(int value) 
{
	Bool flag = false;
	for (int i = 2; i < value; ++i) {
		if (value % i == 0) {
			flag = true;
			break;
		}
	}
	return flag;
}

int64 exponentiation(int64 value, int32 index) 
{
	int64 j = 1;
	for (int i = 0; i != index; i++) 
	{
		j *= value;
	}
	return 0;
}

int main()
{
	uint64 n;
	uint64* a;

	uint64 b = 1;

	scanf("%llu", &n);
	a = (uint64*)malloc(sizeof(uint64) * n);
	for (int i = 0; i != n; i++)
	{
		scanf("%llu", &a[i]);
	}

	for (int i = 0; i != n; i++)
	{
		b *= a[i];
		/*if (b > OVER) 
		{
			break;
		}*/
	}

	if (b > 1000000000000000000)
	{
		printf("-1");
	}
	else
	{
		printf("%lld", b);
	}
	return 0;
}