#include<bits/stdc++.h>
using namespace std;

#define push_back pb

void solve(){

    int n;
    cin >> n;
    long long int arr[n];
    long long int res=1;
    int f=0;
    for(int i=0;i<n;i++){
        cin >> arr[i];
    }
    sort(arr,arr+n);
    if(arr[0]==0){
        cout << 0 << endl;
        return ;
    }
    for(int i=0;i<n;i++){
        if(arr[i]>1000000000000000000){
            cout << -1 << endl;
            f=1;
            break;
        }
        res=res*arr[i];
        if(res>1000000000000000000){
            cout << -1 << endl;
            f=1;
            break;
        }
    }
    if(f==1){
        return;
    }
    if(res<0 || res>1000000000000000000){
        //cout << res ;
        cout << -1 << endl;
    }else{
    cout << res << endl;
    }
    
}
int main(){
    int t=1;
    //cin >> t;
    while(t--){
        solve();
    } 
}