#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,a,p=1,l=1;;
    cin>>n;
    while(n--)
    {
        cin>>a;
        p*=a;
        if(p>1e18)
        {
            l=0;;
        }
    }
    if(l==1)
        cout<<p;
    else
        cout<<"-1";




}
