#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  long long N;
  cin >> N;
  vector<long long> A(N);
  long long ans = 1;
  for (long long i = 0; i < (long long)N; i++) {
    cin >> A[i];
    if (A[i] == 0) {
      cout << 0 << endl;
      return 0;
    }
    if (ans > 1000000000000000000 / A[i]) {
      cout << -1 << endl;
      return 0;
    } else {
      ans *= A[i];
    }
  }
  cout << ans << endl;
  return 0;
}
