/*---------------------------------------------------------------------*/
#include<bits/stdc++.h>
//#include <cassert>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
/*---------------------------------------------------------------------*/
#define FAST        ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ff          first
#define ss          second
#define ll          long long
#define ull         unsigned long long
#define pii         pair<int,int>
#define mp          make_pair
#define psb         push_back
#define psf         push_front
#define ppb         pop_back
#define ppf         pop_front
#define all(x)      x.begin(),x.end()
#define TESTS       int test;cin>>test;for(int tcase=1;tcase<=test;tcase++)
#define ordered_set tree< int, null_type, less_equal< int >, rb_tree_tag, tree_order_statistics_node_update>
/*--------------------------------------------------------------------*/
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v)
{ os << '{'; string sep;for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T> ostream& operator<<(ostream &os, const set<T> &v)
{ os << '{'; string sep;for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T> ostream& operator<<(ostream &os, const multiset<T> &v)
{ os << '{'; string sep;for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p)
{ return os << '(' << p.first << ", " << p.second << ')'; }
void dbg_out() { cerr << " "; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }
#ifndef ONLINE_JUDGE
#define cc(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__);
#define ccm(x)  cerr << "(" << #x <<") : "<<endl;for(auto i : x){ cerr<<"["<<i.ff<<"] = "<<i.ss<<endl;}
#define OK      cerr << "LINE "<<__LINE__<<" :"<<endl;
#define ee      cout<<endl;
#else
#define cc(...)
#define OK
#define ccm(x)
#endif
/*---------------------------------------------------------------------*/
#define MXN (ll)(1e6)
#define MOD (ll)(1e9+7)
#define INF (ll)(1e18)
#define inf (int)(2e9)
vector <vector<int>> V;
int main()
{
    FAST
    int n;cin>>n;
    vector <ll> N(n);
    bool f=0;
    for(ll &x : N) {cin>>x;if(x==0) f=1;}
    if(f) {cout<<0<<endl;return 0;}
    ll mul=1;
    for(int i=0;i<n;i++)
    {
        if(INF/mul+1*(INF%mul!=0)<N[i])
        {
            cout<<-1<<endl;return 0;
        }
        mul=mul*N[i];

    }
    if(mul>INF) cout<<-1<<endl;
    else cout<<mul<<endl;
    return 0;
}
/*--------------------------------------------------------------------*/
/*
>Check Corner Cases (n==1 or T==1)
>Overflow issues?
>LB / UB !!not found!! check?
>slow multi-set operations?try without multi-set
*/
/*--------------------------------------------------------------------*/
/* ---INPUT---
--------(1)------


-------(2)-------



-------(3)-------


-------(4)-------



--------------
*/
/*-----------------------MEHEDI HASAN,CSE-JU--------------------------*/



Measured memory_bytes: 3992