#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int n, a[N];
int freq[1000001];
bool can[1000001];
vector<int> sol;
int main(int argc, char **argv) {
  scanf("%d", &n);
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    sum += a[i];
    ++freq[a[i]];
  }
  for (int i = 0; i < n; ++i) {
    long long need = sum - 2 * a[i];
    if (need >= 0 && need <= 1000000 &&
        (freq[need] > 1 || (need != a[i] && freq[need] > 0)))
      can[need] = true;
  }
  for (int i = 0; i < n; ++i)
    if (can[a[i]]) sol.push_back(i + 1);
  printf("%d\n", (int)sol.size());
  for (size_t i = 0; i < sol.size(); ++i) printf("%s%d", i ? " " : "", sol[i]);
  puts("");
  return 0;
}
