#include <bits/stdc++.h>
using namespace std;
int n, a[200005], f[1000005], an[200005], cnt = 0;
int main() {
  long long sum = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    f[a[i]]++;
    sum += a[i];
  }
  for (int i = 0; i < n; i++) {
    long long ans = (sum - a[i]);
    if (ans & 1)
      continue;
    else
      ans /= 2;
    if (ans > 1000003)
      continue;
    else if (ans == a[i] && f[ans] > 1)
      an[cnt++] = i + 1;
    else if (ans != a[i] && f[ans])
      an[cnt++] = i + 1;
  }
  printf("%d\n", cnt);
  for (int i = 0; i < cnt; i++) printf("%d ", an[i]);
  return 0;
}
