#include <bits/stdc++.h>
using namespace std;
const int N = 200000, A = 1000000;
int aa[N], kk[A + 1];
int main() {
  int n;
  cin >> n;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    sum += a;
    kk[a]++;
    aa[i] = a;
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    int a = aa[i];
    sum -= a;
    kk[a]--;
    if (sum % 2 == 0 && sum / 2 <= A && kk[sum / 2]) aa[cnt++] = i;
    sum += a;
    kk[a]++;
  }
  cout << cnt << '\n';
  while (cnt--) cout << aa[cnt] + 1 << ' ';
  cout << '\n';
  return 0;
}
