#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
int n, x, idx, cnt[N], d[N], ft[N], pre[N];
bool odd;
map<long long, int> lo, hi;
long long bound, l[N], r[N];
void update(int i, int val) {
  if (i == 0) return;
  for (; i <= n; i += i & -i) ft[i] += val;
}
int get(int i) {
  int res = 0;
  for (; i; i -= i & -i) res += ft[i];
  return res;
}
int get(int l, int r) {
  if (l == 0) return get(r);
  return get(r) - get(l - 1);
}
void push(map<long long, int> &m, long long val) { m[val]++; }
void del(map<long long, int> &m, long long val) {
  if (m[val] == 1)
    m.erase(val);
  else
    m[val]--;
}
void marking(long long l, long long r) {
  l = max(l, 0LL);
  r = min(r, (long long)n);
  if (l > r) return;
  pre[l]++;
  pre[r + 1]--;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = (1); i <= (n); ++i) {
    cin >> x;
    cnt[x]++;
    update(x, +1);
    odd ^= (x % 2);
  }
  for (int i = (n); i >= (1); --i) {
    for (int NhiThun = 0; NhiThun < (cnt[i]); ++NhiThun) d[++idx] = i;
  }
  l[1] = d[1];
  for (int i = (2); i <= (n); ++i) r[1] += min(d[i], 1);
  push(lo, l[1] - r[1]);
  update(d[1], -1);
  for (int i = (2); i <= (n); ++i) {
    l[i] = l[i - 1];
    r[i] = r[i - 1];
    l[i] += d[i];
    update(d[i], -1);
    r[i] += -min(d[i], i - 1) + get(i, n);
    push(lo, l[i] - r[i] - (long long)i * (i - 1));
  }
  push(hi, (long long)n * (n + 1) - l[n]);
  marking(max(0LL, lo.rbegin()->first),
          min((long long)d[n], hi.begin()->first));
  d[0] = n;
  for (int i = (n); i >= (1); --i) {
    del(lo, l[i] - r[i] - (long long)i * (i - 1));
    l[i] -= d[i];
    r[i] += min(d[i], i);
    push(hi, r[i] + (long long)i * (i - 1) - l[i]);
    marking(max((long long)d[i], (lo.empty() ? 0LL : lo.rbegin()->first)),
            min((long long)d[i - 1], hi.begin()->first));
  }
  bool flag = 0;
  int cur = 0;
  for (int i = (0); i <= (n); ++i) {
    cur += pre[i];
    if (cur > 0 && i % 2 == odd) {
      cout << i << ' ';
      flag = 1;
    }
  }
  if (!flag) cout << -1;
}
