#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    long long int a,n;
    cin>>n;
    ll mul=1;
    for(ll i=0;i<n;i++)
    {
        cin>>a;
        mul*=a;
    }
    if(mul>=1000000000000000001)
    {
        cout<<-1;
        return 0;
    }
    cout<<mul;
    return 0;
}