#include <stdio.h>
#include <malloc.h>
#include <stdlib.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;



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 > 1000000000000000000) {
		printf("-1");
	}
	else {
		printf("%llu", b);
	}


	return 0;
}