#include <iostream>
using namespace std;

int main()
{
	long long unsigned int N;
	cin >> N;
	long long unsigned int A[N];
	for(int i=0; i<N; i++)
	{
		cin >> A[i];
	}
	
	long long unsigned int tmp = 1;
	for(int i=0; i<N; i++)
	{
		tmp = tmp * A[i];
	}
	if(tmp > 1000000000000000000)
	{
		cout << -1;
	}
	else
	{
		cout << tmp;
	}
	
	return 0;
}