#include <bits/stdc++.h>

using namespace std;

int main(){
  int N;
  vector<long long int> A(N);
  
  cin >> N;
  for(int i=0;i<N;i++){
    cin >> A[i];
    if(A[i] == 0){
      cout << 0 << endl;
      return 0;
    }
  }

  long long int mul=1;
  for(int i=0;i<N;i++){
    if(log10(mul)+log10(A[i])>18.0){
      cout << -1 << endl;
      return 0;
    }

    mul *= A[i];
    if(mul > 1e10){
      cout << -1 << endl;
      return 0;
    }

  }
  cout << mul << endl;
  return 0;     

}
