#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define long long ll
int main(){
  int n; 
  cin >> n;
  int128_t a;
  int128_t ans=1;
  for(int i=0; i<n; i++){
    cin >> a;
    ans *=a;
  }
 
  if(ans<=pow(10, 17)){
    //cout << pow(10, 18);
    printf("%ld", ans);
  } else {
    cout << -1;
  }
}
