#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void umax(T &a, T b) {
  if (a < b) a = b;
}
const int maxn = 200000 + 10;
const int INF = 1e9 + 7;
inline void solve(void) {
  int n, x;
  cin >> n;
  int f = 0;
  for (int i = (0); i < (n); i++) {
    cin >> x;
    if (x == 1) f = 1;
  }
  if (f)
    cout << "-1";
  else
    cout << "1";
}
void init() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
}
int main(int argc, const char *argv[]) {
  init();
  solve();
  return 0;
}
