#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, a[1000];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  if (a[0] == 1)
    cout << "-1\n";
  else {
    for (int i = 0; i < 1000000; i++) {
      if (a[i] > i + 1) {
        cout << i + 1 << endl;
        break;
      }
    }
  }
}
