#include <iostream>
using namespace std;

int n;
long long t = 1;
long long a[100000];

int main()
{
	cin >> n;

	for (int i = 0; i < n; i++) {
		cin >> a[i];

		if (a[i] == 0)
			t = 0;
	}

	if (t != 0) {

		for (int i = 0; i < n; i++){

			if (t <= 1000000000000000000 / a[i])
				t *= a[i];
			else {
				t = -1;
				break;
			}
		}
	}

	cout << t << endl;
}
