#include <iostream>
#include <stdio.h>
#include <math.h>

using namespace std;

long long n, t;

long long res = 1;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(nullptr);
	cin >> n;
	for (int i = 1; i <= n; ++ i)
	{
		cin >> t;
		{
			res *= t;
		}
	}
	cout.tie(0);
	if (res > 1000000000000000000) cout << -1;
	else cout << res;
}