#include <bits/stdc++.h>
using namespace std;
int main(){
    long long int t;
    int n;
    cin>>n;
    long long int ans=1;
    double a=0;
    for(int i=0;i<n;i++) cin>>t,ans=ans*t,a=a+(log(t)*1.0/log(10));
   // cout<<a;
    if(a>18 || ans>1000000000000000000ll) cout<<-1;
    else cout<<ans;
    cout<<endl;
    return 0;

}