#include <bits/stdc++.h>
using namespace std;
unsigned long long cnt[1000006];
unsigned long long mx = 1e6;
int main() {
  unsigned long long n;
  cin >> n;
  unsigned long long a[n];
  unsigned long long sum = 0;
  for (unsigned long long i = 0; i < n; i++) {
    cin >> a[i];
    cnt[a[i]] += 1;
    sum += a[i];
  }
  vector<unsigned long long> ans;
  for (unsigned long long i = 0; i < n; i++) {
    sum -= a[i];
    cnt[a[i]] -= 1;
    if (sum % 2 == 0) {
      if (sum % 2 == 0 && sum / 2 <= mx && cnt[sum / 2] > 0) {
        ans.push_back(i + 1);
      }
    }
    sum += a[i];
    cnt[a[i]] += 1;
  }
  cout << ans.size() << "\n";
  if (ans.size() != 0) {
    for (unsigned long long i = 0; i < ans.size(); i++) cout << ans[i] << " ";
    cout << "\n";
  }
}
