#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000000000000000;
 
main(){
    int n;
    cin>>n;
    ll a[n];
    ll prod = 1;
    for(int i =0;i<n;i++){
        cin>>a[i];
        if(a[i] == 0){
            cout<<"0";
            exit(0);
        }
    }    
    for(int i=0;i<n;i++){
        if(a[i]<= mod/prod)
        prod*= a[i];
        else{
            cout<<"-1";
            exit(0);
        }
    }
    cout<<prod<<"\n";
}