#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n;
cin >> n;
long long res = 1;
while (n--)
{
    long long x;
    cin >>x;
    res *= x;
}
if (res >= pow(10,18))
    cout << -1;
else
    cout << res;
}
