#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MAX = 1e18;

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for (auto &e : a) cin >> e;
  sort(a.begin(), a.end());

  bool valid = true;
  __int128 r = 1;
  for (auto e : a) {
    valid = valid && r * e <= MAX;
    r *= e;
  }
  cout << (valid ? (ll)r : -1) << endl;
}
