#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, sum = 0;
  cin >> n;
  vector<int> a;
  map<long long, long long> mp;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    a.push_back(t);
    mp[t]++;
    sum += t;
  }
  vector<long long> ans;
  for (int i = 0; i < n; i++) {
    sum -= a[i];
    mp[a[i]]--;
    if (sum % 2 == 0 && sum / 2 <= pow(10, 6) && mp[sum / 2] > 0)
      ans.push_back(i);
    ;
    sum += a[i];
    mp[a[i]]++;
  }
  cout << ans.size() << endl;
  for (auto i : ans) cout << i + 1 << " ";
  return 0;
}
