#include <bits/stdc++.h>
#include <stdint.h>
#define mod 1000000007
#define ull unsigned ll
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define pi 3.1415926535897932
using namespace std;

/*-------------------------------------------------------------*/
//for (a*b)%mod

uint64_t mulmod(uint64_t a, uint64_t b, uint64_t m)
{
	long double x;
	uint64_t c;
	int64_t r;
	if (a >= m) a %= m;
	if (b >= m) b %= m;
	x = a;
	c = x * b / m;
	r = (int64_t)(a * b - c * m) % (int64_t)m;
	return r < 0 ? r + m : r;
}

/*-------------------------------------------------------------*/

ull binpowmod(ull a, ull b, ull m)
{
	ull res = 1;
	while (b > 0)
	{
		if (b & 1)
		{
			res = ((res % m) * (a % m)) % m;
		}
		a = ((a % m) * (a % m)) % m;
		b >>= 1;
	}
	return res;
}

/*-------------------------------------------------------------*/

ll countsetbits(ll n)
{
	ll count = 0;
	while (n > 0)
	{
		n = n & (n - 1);
		count++;
	}
	return count;
}

/*-------------------------------------------------------------*/
ll binpow(ll a, ll b)
{
	ll res = 1;
	while (b > 0)
	{
		if (b & 1)
		{
			res *= a;
		}
		a *= a;
		b >>= 1;
	}
	return res;
}
/*-------------------------------------------------------------*/
ll binarysearch(ll l, ll r, ll a[], ll x)
{
	while (l <= r)
	{
		ll mid = l + ((r - l) / 2);

		if (a[mid] == x )
		{
			return mid ;
		}
		if (a[mid] < x)
		{
			l = mid + 1;
		}
		else
		{
			r = mid - 1;
		}
	}
	return -1;
}

void printNcR(ll n, ll r)
{

	ll p = 1, k = 1;

	if (n - r < r)
		r = n - r;

	if (r != 0)
	{
		while (r)
		{
			p *= n;
			k *= r;

			ll m = __gcd(p, k);
			p /= m;
			k /= m;

			n--;
			r--;
		}
	}

	else
		p = 1;

	cout << p << "\n";
}
/*--------------------------------------------------------------*/
//Adjacency list

vector<ll>adj[100005];

ll vis[100005];  //how many i-th nodes have been visited
void dfs(ll node)
{
	vis[node] = 1;
	for (ll child : adj[node])
	{
		if (!vis[child])
		{
			dfs(child);
		}
	}
}

/*--------------------------------------------------------------*/
/* Upper bound of x gives numbers less than or equal to x */

ll countdig(ll n)
{
	ll count = 0;
	while (n > 0)
	{
		n /= 10;
		count++;
	}
	return count;
}

/*-------------------------------------------------------------*/

bool primech(ll n)
{
	// Corner cases
	if (n <= 1)  return false;
	if (n <= 3)  return true;

	// This is checked so that we can skip
	// middle five numbers in below loop
	if (n % 2 == 0 || n % 3 == 0) return false;

	for (int i = 5; i * i <= n; i = i + 6)
		if (n % i == 0 || n % (i + 2) == 0)
			return false;

	return true;
}

/*----------------------------------------------------------------*/

bool sortbysec(const pair<char, char> &a, const pair<char, char> &b)
{
	return (a.second < b.second);
}

// Sort first part in descending
bool sortinrev(const pair<char, char> &a, const pair<char, char> &b)
{
	return (a.first > b.first);
}

/*-------------------------------------------------------------*/

clock_t time_p = clock();
void TLE()
{
	time_p = clock() - time_p;
	cerr << "Time Taken : " << (float)(time_p) / CLOCKS_PER_SEC << "\n";
}

/*-------------------------------------------------------------*/

/*vector<ll>v;
bool prime[10000001]
void seive()
{
	memset(prime,1,sizeof(prime));
	for(ll i=2;i*i<=10000001;i++)
	{
		if(prime[i]==1)
		{
			for(ll j=1;j<=i*i;j+=i)
			{
				prime[j]=0;
			}
		}
	}

} */



/*-------------------------------------------------------------*/
int main()
{

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	ll n;
	cin >> n;
	ll a[n];
	ld sum = 0;
	ll pro = 1;
	for (ll i = 0; i < n; i++)
	{
		cin >> a[i];
		if (!a[i])
		{
			cout << "0\n";
			return 0;
		}
		sum += log10(a[i]);
		pro *= a[i];
	}
	if (sum > 18.1)
	{
		cout << "-1\n";
		return 0;
	}
	else if (pro > 1000000000000000000)
	{
		cout << "-1\n";
		return 0;
	}
	cout << pro << "\n";
	return 0;

}

/* Important points :
 1: If the question seems likely to be solved in O(n^2) check whether it will pass
    the time limits or not else solve it in O(nlogn).
 2: If the question seems likely to be solved in O(n) , check whether it will pass
    O(n)~10^5 opertaions; else try it in O(logn) or O(sqrt(n)).
 3: Checking corner cases before each submission is important and include them in test
    cases will help save time.
 4: Check for constraints always if the product or some term involved exceeds 10^18
    then there is an integer overflow; for checking those cases use log10.
 */



Measured memory_bytes: 7004