// Slower C++ solution:
#include<bits/stdc++.h>

#define ll long long

#define ull unsigned long long

#define IO ios::sync_with_stdio(false), cin.tie(0)

#define endl '\n'

#define pi acos(-1.0)

#define lowbit(x) ((x)&(-(x)))

#define debug(x) cout<<x<<'\n'

#define pii pair<ll,pair<ll,ll> >

using namespace std;

const ll INF=0x3f3f3f3f3f3f3f3f;

const int inf = 0x3f3f3f3f;

//const ll mod = 1e9+7;

ll mod;

const double eps = 1e-6;

ll gcd(ll a, ll b) {return b==0?a:gcd(b, a%b);}

ll lcm(ll a, ll b) {return a/gcd(a, b)*b;}

ll mul(ll a,ll b){ll ans=0;a%=mod,b%=mod;while(b) { if(b&1) ans = (ans+a)%mod; a = (a*2)%mod; b >>= 1; }return ans;}

ll powmod(ll a,ll b){ ll ans = 1, pow = a; while(b) { if(b&1) ans = (ans*pow)%mod; pow = (pow*pow)%mod; b >>= 1; } return ans;}

//(b/a)%p=b*a^(p-2)%p

int pr(ll num){//判素

     if(num == 1) return 0;

     if(num ==2|| num==3 ) return 1 ;

     if(num %6!= 1&&num %6!= 5) return 0 ;

     int tmp =sqrt( num);

     for(int i= 5;i <=tmp; i+=6 )

          if(num %i== 0||num %(i+ 2)==0 )return 0 ;

     return 1 ;

}

int Day(int y,int m, int d){if(m==1||m==2) { m+=12; y--; }int w=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7;return w+1;}

int pri[1000005];

void getpri(){

    memset(pri,true,sizeof(pri));

    pri[0]=pri[1]=0;

    for(int i=2;i<=1000000;i++){

        if(pri[i]){

            for(int j=2*i;j<=1000000;j+=i)pri[j]=0;

        }

    }

}

inline int read() {

    int c = 0, f = 1;

    char ch = getchar();

    while (ch < '0' || ch > '9') {

        if (ch == '-') f = -1;

        ch = getchar();

    }

    while (ch >= '0' && ch <= '9') {

        c = c * 10 + ch - '0';

        ch = getchar();

    }

    return c * f;

}

//int pre[100005];

//void init(){

//    for(int i=1; i<=100005;++i) pre[i]=i;

//}

//int getf(int x){

//    if(pre[x] == x) return x;

//    else return pre[x] = getf(pre[x]);

//}

//void join(int x,int y){

//    int a = getf(x);

//    int b = getf(y);

//    if(a!=b) pre[b]=a;

//}

//大小写转换

//String s;

//Form(s.begin(),s.end(),s.begin(),::toupper);

//Form(s.begin(),s.end(),s.begin(),::tolower);

//(char)toupper('a')

//(char)tolower('B')

//#pragma comment(linker, "/STACK:1024000000,1024000000")//外挂开栈

//stable_sort 排序不处理相同元素

//map<int,int>::reverse_iterator rit;

//for(rit=mp.rbegin();rit!=mp.rend();rit++)

//vec动态二维数组

//vector<vector<int>> g(26,vector<int>(100005));

//初始化vec里面套了n个vec

//lower_bound(begin,end,num) 有序数列中返回第一个>=num的数字的地址

//upper_bound( begin,end,num) 返回第一个>num的数字的地址

const int maxn=1e5+5;

ll a[maxn];

ll maxx=1e18;

int main(){

    int n;

    cin>>n;

    for(int i=0;i<n;++i){

        cin>>a[i];

    }

    sort(a,a+n);

    if(a[0]==0) cout<<0<<endl;

    else {

        ull ans=1;

        int f=1;

        for(int i=0;i<n;++i){

            if(maxx/ans>=a[i]){

                ans*=a[i];

            }

            else{

                f=0;

                break;

            }

        }

        if(f) cout<<ans<<endl;

        else cout<<-1<<endl;

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.278207918379635x):
#include<stdio.h>

int main (){



	long long int berapaKali;	

	scanf("%lld", &berapaKali);

	long long int a1[berapaKali];

	long long int a2 = 1;

	long long int max = 1000000000000000000;

	long long int hasil ;

	

	for(int j=0;j<berapaKali;j++){

		scanf("%lld", &a1[j]);

	}

	

	for(int h=0;h<berapaKali;h++){

	

		if(a1[h]==0){

			printf("0\n");

			return 0;

		}

	}

	for(int i=0;i<berapaKali;i++){

		if(a1[i]<=max/a2){	

		a2*= a1[i];	

		}else{

		printf("-1\n");

		return 0;

		}

	}

	

	printf("%lld\n", a2);



	return 0;

}