#pragma GCC target("avx")
//#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define DB double
#define LD long double
#define ST string
#define BS bitset
#define PA pair<LL,LL>
#define VE vector
#define VL vector<LL>
#define VP vector<pair<LL,LL>>
#define VVL vector<vector<LL>>
#define PQ priority_queue
#define PQS priority_queue<LL,vector<LL>,greater<LL>>
#define PB push_back
#define POB pop_back
#define PF push_front
#define POF pop_front
#define EB emplace_back
#define MP make_pair
#define TS to_string
#define TU to_ullong
#define BPL __builtin_popcountll
#define FOR(i,a,n) for(i=a;i<n;++i)
#define FORR(i,a,n) for(i=n-1;i>=a;--i)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) FORR(i,0,n)
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define SORT(a) sort(ALL(a))
#define REV(a) reverse(ALL(a))
#define UB(a,n) *upper_bound(ALL(a),n)
#define LB(a,n) *lower_bound(ALL(a),n)
#define INF 1145141919810364364LL
#define PI 3.14159265358979
#define MOD 1000000007
//#define MOD 998244353
#define ERR 0.00000001
#define FAST cin.tie(0);ios::sync_with_stdio(false)

void Yn(LL a){if(a)printf("Yes\n");else printf("No\n");}
void YN(LL a){if(a)printf("YES\n");else printf("NO\n");}
LL pwmn(LL a,LL n){LL ans=1;while(ans<a)ans*=n;return ans;}
LL dig(LL n){LL ret=0;while(n)n/=10,ret++;return ret;}
LL LBn(VL &v,LL a){LL mx=v.size(),mn=-1,md;while(mx-mn>1){md=(mx+mn)/2;if(v[md]<a)mn=md;else mx=md;}return mx;}
LL GCD(LL a,LL b){LL c=1,tmp=max(a,b);b=min(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;}
LL LCM(LL a,LL b){return a*b/GCD(a,b);}
int lcmp(const void* a,const void* b){if(*(LL*)a>*(LL*)b)return 1;if(*(LL*)a<*(LL*)b)return -1;return 0;}
int lcmpr(const void* a,const void* b){if(*(LL*)a>*(LL*)b)return -1;if(*(LL*)a<*(LL*)b)return 1;return 0;}
int ccmp(const void* a,const void* b){return *(char*)a-*(char*)b;}
int ccmpr(const void* a,const void* b){return *(char*)b-*(char*)a;}
int scmp(const void* a,const void* b){return strcmp((char*)a,(char*)b);}
int scmpr(const void* a,const void* b){return strcmp((char*)b,(char*)a);}
LL cmod(LL a,LL m){if(a%m<0)return a%m+abs(m);else return a%m;}
LL DIV(LL a,LL d,LL m){LL l=m,x=1,y=0,k;while(l){k=d/l;d-=k*l;swap(l,d);x-=k*y;swap(x,y);}return cmod(a*cmod(x,m),m);}
LL POW(LL a,LL n,LL m){LL ans=1;while(n>0){if(n&1)ans=ans*a%m;a=a*a%m;n>>=1;}return ans;}
VL fact,finv,inv;
void comi(LL n){LL i;fact.resize(max(2LL,n+1));finv.resize(max(2LL,n+1));inv.resize(max(2LL,n+1));fact[0]=fact[1]=1;finv[0]=finv[1]=1;inv[1]=1;FOR(i,2,n+1){fact[i]=fact[i-1]*i%MOD;inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;finv[i]=finv[i-1]*inv[i]%MOD;}}
LL com(LL n,LL k){if(n<k||n<0||k<0)return 0;return fact[n]*(finv[k]*finv[n-k]%MOD)%MOD;}
bool cmps(pair<LL,LL> a,pair<LL,LL> b){if(a.second!=b.second)return a.second<b.second;return a.first<b.first;}
template<typename T>bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}

#define BI bigint
struct bigint{
  VL bint;bool sign;const int size=1000000000,len=9,bsize=1<<29,blen=29;
  bigint &fix(){LL i=(LL)bint.size()-1;while(i>=0&&bint[i]==0)--i;bint.resize(i+1);if(bint.size()==0)sign=0;return *this;}
  bigint():sign(0){}
  bigint(LL n){sign=0;if(n<0)sign=1;else n=-n;for(;n<0;n/=size)bint.PB(abs(n%size));}
  bigint(const ST &s){LL f=0,a=size,i,n;sign=0;if(s[0]=='-')sign=1,++f;for(i=s.size()-1;i>=f;--i,a*=10){n=s[i]-'0';if(n<0||9<n){cerr<<"error: parse error: "<<s<<endl;exit(1);}if(a==size)a=1,bint.PB(n);else bint.back()+=n*a;}fix();}
  bool operator<(const bigint &b)const{LL i;if(sign!=b.sign)return sign>b.sign;if(bint.size()!=b.bint.size())return (bint.size()<b.bint.size())^sign;repr(i,(LL)bint.size())if(bint[i]!=b.bint[i])return (bint[i]<b.bint[i])^sign;return 0;}
  bool operator>(const bigint &b)const{return b<(*this);}
  bool operator<=(const bigint &b)const{return !(b<(*this));}
  bool operator>=(const bigint &b)const{return !((*this)<b);}
  bool operator!=(const bigint &b)const{return (*this)<b||b<(*this);}
  bool operator==(const bigint &b)const{return !((*this)<b||b<(*this));}
  bigint operator-()const{bigint ret(*this);if(bint.size())ret.sign=!ret.sign;return ret;}
  bigint operator+(const bigint &b)const{bigint ret(*this);return ret+=b;}
  bigint operator-(const bigint &b)const{bigint ret(*this);return ret-=b;}
  bigint operator++(int){bigint ret(*this);*this+=1;return ret;}
  bigint operator--(int){bigint ret(*this);*this-=1;return ret;}
  bigint operator*(int n)const{bigint ret(*this);return ret*=n;}
  bigint operator*(const bigint &b)const{bigint ret(*this);return ret*=b;}
  bigint operator/(int n)const{bigint ret(*this);return ret/=n;}
  bigint operator/(const bigint &b)const{bigint ret(*this);return ret/=b;}
  bigint operator%(int n)const{bigint ret(*this);return ret%=n;}
  bigint operator%(const bigint &b)const{bigint ret(*this);return ret%=b;}
  bigint operator&(const bigint &b)const{bigint ret(*this);return ret&=b;}
  bigint operator|(const bigint &b)const{bigint ret(*this);return ret|=b;}
  bigint operator^(const bigint &b)const{bigint ret(*this);return ret^=b;}
  bigint operator<<(int n)const{bigint ret(*this);return ret<<=n;}
  bigint operator>>(int n)const{bigint ret(*this);return ret>>=n;}
  bigint &operator=(const bigint &b){sign=b.sign;bint=b.bint;return *this;}
  bigint &operator+=(const bigint &b){LL i,a=0;if(sign!=b.sign)return *this-=(-b);if(bint.size()<b.bint.size())bint.resize(b.bint.size());rep(i,b.bint.size())bint[i]+=b.bint[i]+a,a=bint[i]/size,bint[i]%=size;if(a){if(bint.size()==b.bint.size())bint.PB(1);else ++bint[b.bint.size()];}return *this;}
  bigint &operator-=(const bigint &b){LL i,a=0;if(sign!=b.sign)return *this+=(-b);VL v(b.bint);if((*this<b)^sign)bint.swap(v),sign=!sign;rep(i,bint.size())bint[i]+=size-(i<v.size()?v[i]:0)+a,a=bint[i]/size-1,bint[i]%=size;return this->fix();}
  bigint &operator++(){*this+=1;return *this;}
  bigint &operator--(){*this-=1;return *this;}
  bigint &operator*=(int n){LL i,a=0;sign^=(n<0);n=abs(n);rep(i,bint.size())bint[i]*=n,bint[i]+=a,a=bint[i]/size,bint[i]%=size;bint.PB(a);return this->fix();}
//bigint &operator*=(const bigint &b){LL i,j,n;VL p,q,v;sign^=b.sign;rep(i,bint.size()){n=bint[i];rep(j,len)p.PB(n%10),n/=10;}rep(i,b.bint.size()){n=b.bint[i];rep(j,len)q.PB(n%10),n/=10;}v=FFT(p,q);n=0,j=1;bint.resize(0);rep(i,v.size()){n+=v[i]*j,j*=10;if(j==size)bint.PB(n%size),n/=size,j=1;}bint.PB(n%size),bint.PB(n/size);return this->fix();}
  bigint &operator*=(const bigint &b){LL i,j,a,n,s=bint.size(),t=b.bint.size();VL v(s+t);sign^=b.sign;rep(i,s){a=0;rep(j,t){n=bint[i]*b.bint[j]+v[i+j]+a;a=n/size;v[i+j]=n%size;}v[i+t]+=a;}bint=v;return this->fix();}
  bigint &operator/=(int n){return *this=divmod(n).first;}
  bigint &operator/=(const bigint &b){return *this=divmod(b).first;}
  bigint &operator%=(int n){return *this=divmod(n).second;}
  bigint &operator%=(const bigint &b){return *this=divmod(b).second;}
  bigint &operator&=(const bigint &b){if(*this<0||b<0){cerr<<"error: bit operation of negative bigint"<<endl;exit(1);}VL u=binary(*this),v=binary(b);LL i,s=v.size();if(u.size()<s)u.resize(s);rep(i,u.size())u[i]&=(i<s?v[i]:0);return *this=decimal(u);}
  bigint &operator|=(const bigint &b){if(*this<0||b<0){cerr<<"error: bit operation of negative bigint"<<endl;exit(1);}VL u=binary(*this),v=binary(b);LL i,s=v.size();if(u.size()<s)u.resize(s);rep(i,u.size())u[i]|=(i<s?v[i]:0);return *this=decimal(u);}
  bigint &operator^=(const bigint &b){if(*this<0||b<0){cerr<<"error: bit operation of negative bigint"<<endl;exit(1);}VL u=binary(*this),v=binary(b);LL i,s=v.size();if(u.size()<s)u.resize(s);rep(i,u.size())u[i]^=(i<s?v[i]:0);return *this=decimal(u);}
  bigint &operator<<=(int n){if(*this<0||n<0){cerr<<"error: bit operation of negative bigint"<<endl;exit(1);}bigint k(2),b(1);while(n){if(n&1)b*=k;k*=k;n>>=1;}return *this*=b;}
  bigint &operator>>=(int n){if(*this<0||n<0){cerr<<"error: bit operation of negative bigint"<<endl;exit(1);}bigint k(2),b(1);while(n){if(n&1)b*=k;k*=k;n>>=1;}return *this/=b;}
  friend istream &operator>>(istream &is,bigint &b){ST s;is>>s;b=bigint(s);return is;}
  friend ostream &operator<<(ostream &os,const bigint &b){LL i;if(b.sign)os<<'-';if(!b.bint.size())os<<0;else os<<b.bint.back();repr(i,(LL)b.bint.size()-1){os.width(b.len);os.fill('0');os<<b.bint[i];}return os;}
  pair<bigint,bigint> divmod(int n){if(n==0){cerr<<"error: division by zero"<<endl;exit(1);}LL i,a,q=0;bigint p;p.sign=sign^(n<0);n=abs(n);repr(i,(LL)bint.size()){a=q*size+bint[i];p.bint.PB(a/n);q=a%n;}q*=(sign?-1:1);REV(p.bint);return {p.fix(),q};}
  pair<bigint,bigint> divmod(const bigint &b){if(b==0){cerr<<"error: division by zero"<<endl;exit(1);}LL i;int mx,mn,md;bigint c(b),p,q;c.sign=0;repr(i,(LL)bint.size()){q=q*size+bint[i];mn=0,mx=size;if(q>=c){while(mx-mn>1){md=(mn+mx)/2;if(c*md>q)mx=md;else mn=md;}q-=c*mn;}p.bint.PB(mn);}REV(p.bint);p.sign=sign^b.sign;q.sign=sign;return {p.fix(),q.fix()};}
  VL binary(const bigint &b){LL i=1,n=0,k;VL ret;bigint c(b);while(c>0){k=0;if(c%2==1)k=1;n+=k*i,c/=2,i*=2;if(i==bsize)ret.PB(n),n=0,i=1;}if(n)ret.PB(n);return ret;}
  bigint decimal(VL &v){LL i;bigint k(1),ret;rep(i,v.size())ret+=k*(int)v[i],k*=bsize;return ret;}
  LL digit(){if(!bint.size())return 0;return (bint.size()-1)*len+dig(bint.back());}
};

int main(){
  FAST;
  LL i,N,K;
	BI ans=1;
  cin>>N;
	VE<BI> A(N);
	rep(i,N){
		cin>>A[i];
		if(A[i]==0){
			cout<<0<<endl;
			return 0;
		}
	}
	rep(i,N){
		ans*=A[i];
		if(ans>1000000000000000000LL){
			cout<<-1<<endl;
			return 0;
		}
	}

  cout<<ans<<endl;
}


Measured memory_bytes: 11128