#include <bits/stdc++.h>
using namespace std;

int main() {
  long long N;
  cin >> N;
  
  vector<long long>A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  
  long long m = 1;
  
  for (int i = 0; i < N; i++) {
    if (A.at(i) == 0){
      m = 0;
    }
  }
  
 if (m == 1){
    
  for (int i = 0; i < N; i++) {
    if (1000000000000000001 /m  >= A.at(i);) {
      m *= A.at(i);
    }
    else 
      m = -1;
      break;
    }     
  }   
 }
  
  if (m > 1000000000000000000 || m < 0){
    cout << -1 << endl;
  }
  else {
    cout << m << endl;
  }
}


