#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int n, sum, a[N], b[N];
long long S[N];
pair<int, int> calc(int x) {
  int pos = 0, tmp = 0;
  for (; a[pos + 1] > x; b[++tmp] = a[++pos])
    ;
  b[++tmp] = x;
  for (; pos < n;) b[++tmp] = a[++pos];
  for (int i = (int)(1); i <= (int)(n + 1); i++) S[i] = S[i - 1] + b[i];
  pos = n + 2;
  long long sum = 0;
  for (int i = (int)(1); i <= (int)(n + 1); i++) {
    sum += b[i] - 2 * i + 2;
    for (; b[pos - 1] <= i && pos > i + 1; pos--)
      ;
    pos = max(pos, i + 1);
    long long sum2 = S[n + 1] - S[pos - 1] + 1ll * (pos - i - 1) * i;
    if (sum2 < sum) return pair<int, int>(b[i] <= x ? -1 : 1, 0);
  }
  return pair<int, int>(0, 0);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), sum ^= a[i];
  sort(a + 1, a + n + 1, greater<int>());
  int l = 0, r = n, ans = -1;
  if ((l + sum) & 1) l++;
  if ((r + sum) & 1) r--;
  while (l <= r) {
    int mid = (l + r) / 2;
    if ((mid + sum) & 1) mid++;
    if (mid > r || mid < l) break;
    pair<int, int> tmp = calc(mid);
    if (tmp.first == 0) {
      ans = mid;
      break;
    }
    if (tmp.first < 0)
      r = mid - 1;
    else
      l = mid + 1;
  }
  if (ans == -1) return puts("-1"), 0;
  l = 0;
  r = ans - 1;
  int lans = ans;
  while (l <= r) {
    int mid = (l + r) / 2;
    if ((mid + sum) & 1) mid++;
    if (mid > r || mid < l) break;
    pair<int, int> tmp = calc(mid);
    if (tmp.first == 0)
      lans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  l = ans + 1;
  r = n;
  int rans = ans;
  while (l <= r) {
    int mid = (l + r) / 2;
    if ((mid + sum) & 1) mid++;
    if (mid > r || mid < l) break;
    pair<int, int> tmp = calc(mid);
    if (tmp.first == 0)
      rans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  for (; lans <= rans; lans += 2) printf("%d ", lans);
}
