#include <bits/stdc++.h>
using namespace std;
struct B {
  long long S, W;
  friend bool operator<(const B &a1, const B &a2) {
    if (a1.S < a2.S) return true;
    return false;
  }
  friend bool operator<(const B &a1, const long long &a2) {
    if (a1.S < a2) return true;
    return false;
  }
  friend bool operator<(const long long &a1, const B &a2) {
    if (a1 < a2.S) return true;
    return false;
  }
};
long long SE(B b[], long long n, long long K) {
  long long low = 0, high = n - 1, mid;
  while (low <= high) {
    mid = low + (high - low) / 2;
    if (b[mid].S == K)
      return mid;
    else if (b[mid].S < K)
      low = mid + 1;
    else
      high = mid - 1;
  }
  if (low > high) return -1;
}
B b[1000000];
long long d[1000000];
int main() {
  long long n, he = 0, c = 0;
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    cin >> b[i].S;
    he += b[i].S;
    b[i].W = i + 1;
  }
  sort(b, b + n);
  long long kk = he - b[n - 1].S * 2;
  if (he - b[n - 1].S == b[n - 2].S * 2) {
    d[c++] = b[n - 1].W;
  }
  if (!binary_search(b, b + n - 1, kk)) {
    if (c)
      printf("1\n%lld", d[0]);
    else
      printf("0");
    exit(0);
  } else {
    for (long long i = SE(b, n - 1, kk); i < n - 1 && b[i].S == kk; i++) {
      d[c++] = b[i].W;
    }
    for (long long i = SE(b, n - 1, kk) - 1; i >= 0 && b[i].S == kk; i--) {
      d[c++] = b[i].W;
    }
  }
  printf("%lld\n%lld", c, d[0]);
  for (long long i = 1; i < c; ++i) {
    printf(" %lld", d[i]);
  }
  return 0;
}
