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

int main() {
  int64_t N,A=1;
  cin>>N;
  vector<int64_t> B(N);
  for(int64_t &i:B){
    cin>>i;
    if(i==0){
      cout<<0<<endl;
      return 0;
    }
  }
  for(int64_t &j:B){
    if(1000000000000000000/A<j){
      cout<<-1<<endl;
      return 0;
    }
    A*=j;
  }
  cout<<A<<endl;
}