#include <bits/stdc++.h>
using namespace std;
using namespace std;
inline int read() {
  char ch;
  bool sign = 0;
  int res = 0;
  while (!isdigit(ch = getchar()))
    if (ch == '-') sign = 1;
  while (isdigit(ch)) res = res * 10 + (ch ^ 48), ch = getchar();
  if (sign)
    return -res;
  else
    return res;
}
const int maxn = 500000 + 10;
const long long inf = 1e18;
const int maxm = 10000000 + 10;
const int base = 2000000 + 10;
const int apsz = 26;
const long long mod = 998244353;
int a[maxn], n, b[maxn];
inline int judge(int val) {
  vector<int> cnt(n + 1, 0);
  for (auto i = (1); i <= (n); ++i) cnt[a[i]]++;
  cnt[val]++;
  deque<int> now;
  for (auto i = (n); i >= (1); --i) {
    for (auto j = (0); j < (cnt[i]); ++j) now.push_back(i);
  }
  long long Right(0), Left(0);
  int vis(0);
  for (auto k = (n); k >= (0); --k) {
    for (auto i = (0); i < (cnt[k]); ++i) {
      Left += k;
      vis++;
      if (!now.empty() && now.front() == k) {
        now.pop_front();
        Right -= vis - 1;
      } else
        Right -= k;
      for (; !now.empty() && now.back() <= vis;) {
        Right += now.back();
        Right -= vis - 1;
        now.pop_back();
      }
      Right += ((int)(now).size());
      if (Left > Right + 1LL * vis * (vis - 1)) {
        if (k <= val) return 1;
        return -1;
      }
    }
  }
  return 0;
}
inline int solve() {
  int e = accumulate(a + 1, a + 1 + n, 0LL) & 1;
  int l(0), r((n + 1) / 2), L(-1), R(-1);
  while (l < r) {
    int mid = r - (r - l + 1) / 2;
    if (2 * mid + e <= n && judge(2 * mid + e) == -1)
      l = 1 + mid;
    else {
      r = mid;
    }
  }
  if (judge(l * 2 + e) != 0) return 0;
  L = 2 * l + e;
  r = (n + 1) / 2;
  while (l < r) {
    int mid = l + (r - l + 1) / 2;
    if (2 * mid + e > n || judge(2 * mid + e) == 1)
      r = mid - 1;
    else {
      l = mid;
    }
  }
  if (judge(2 * l + e) != 0) return 0;
  R = 2 * l + e;
  for (int i = L; i <= R; i += 2) {
    printf("%d ", i);
  }
  return 1;
}
int main(void) {
  scanf("%d", &(n));
  for (auto i = (1); i <= (n); ++i) scanf("%d", &(a[i])), b[i] = a[i];
  solve() ? puts("") : puts("-1");
  return 0;
}
