#include <iostream>
#include <vector>

using namespace std;

std::vector<long long>A(100010);

int main(){
    int N;
    cin >> N;


    for(int i=0;i<N;i++)
    {
        cin >> A[i];
    }

    int zero = 0; 

    for(int i=0;i<N;i++)
    {
        if(A[i]==0)
        {
            zero++;
        }
    }
    if(zero>0)
    {
        cout << 0 << endl;
        return 0;
    }

    long long seki = 1;

    for(int i=0;i<N;i++)
    {
        if(A[i] <= 1000000000000000000/seki)
        {
            seki = seki*A[i];
        }
        else
        {
            cout << -1 << endl;
            return 0;
        }
    }

    cout << seki << endl;
}
