#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int N = 1000001;
  vector<int> count(N);
  long long n;
  cin >> n;
  vector<long long> a(n), ans;
  long long sum = 0, i, j, k;
  for (i = 0; i < n; i++) cin >> a[i], sum += a[i], count[a[i]]++;
  for (i = 0; i < n; i++)
    if ((sum - a[i]) % 2 == 0 && (sum - a[i]) / 2 < N &&
        (count[(sum - a[i]) / 2] > 1 ||
         (count[(sum - a[i]) / 2] == 1 && a[i] != (sum - a[i]) / 2)))
      ans.push_back(i + 1);
  cout << ans.size() << endl;
  for (auto x : ans) cout << x << " ";
  cout << endl;
  return 0;
}
