#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <iomanip>
#define rep(i,n) for (int i=0; i <(n); ++i)
using namespace std;


int main() {
  int N;
  cin >> N;
  long a[N];
  
for (int i=0; i < N; i++) cin >> a[i];
long b=1;
for (int i=0; i < N; i++){
  b = b*a[i];
}
long thresh;
thresh = pow(10, 18);
if(b <= thresh) cout << b << endl;
if(b > thresh) cout << -1 << endl;
return 0;
}

