#include <bits/stdc++.h>
using namespace std;
map<unsigned long long, vector<int> > num_pos;
vector<int> arr;
vector<int> ans;
bool sudah[2000010];
int main() {
  int n;
  cin >> n;
  int x;
  unsigned long long sum = 0;
  for (x = 1; x <= n; x++) {
    int a;
    cin >> a;
    sum += a;
    arr.push_back(a);
    num_pos[a].push_back(x);
  }
  for (x = 0; x < arr.size(); x++) {
    if (sudah[arr[x]] == 0) {
      int y;
      sudah[arr[x]] = 1;
      unsigned long long need = sum - arr[x] - arr[x];
      if (need == arr[x]) {
        if (num_pos[need].size() == 1) {
        } else {
          for (y = 0; y < num_pos[need].size(); y++) {
            ans.push_back(num_pos[need][y]);
          }
        }
      } else {
        for (y = 0; y < num_pos[need].size(); y++) {
          ans.push_back(num_pos[need][y]);
        }
      }
    }
  }
  cout << ans.size() << endl;
  if (ans.size()) {
    for (x = 0; x < ans.size(); x++) {
      if (x) {
        cout << " ";
      }
      cout << ans[x];
    }
    cout << endl;
  }
}
