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

int main(void) {
  int n;
  cin >> n;
  ll ans = 1;
  for (int i = 0; i < n; i++) {
    ll tmp;
    cin >> tmp;
    ans *= tmp;
    if (ans > 1000000000000000000) {
      ans = -1;
      break;
    }
  }
  cout << ans << endl;
}