#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long sum = 0;
  vector<long long> vec(n);
  unordered_map<long long, unordered_set<long long>> mp;
  for (long long i = 0; i < n; i++) {
    cin >> vec[i];
    sum += vec[i];
    mp[vec[i]].insert(i + 1);
  }
  sort(vec.begin(), vec.end());
  long long temp = sum;
  temp -= vec.back();
  long long left = 0, right = temp, cnt = 0;
  unordered_set<long long> remove;
  for (long long i = 0; i < n; i++) {
    if (right == 0) {
      left -= vec[i - 1];
      if (left == vec[i - 1]) {
        remove.insert(vec[i]);
      }
      continue;
    }
    right -= vec[i];
    if (left + right == vec.back()) {
      remove.insert(vec[i]);
    }
    left += vec[i];
  }
  for (auto x : remove) cnt += mp[x].size();
  cout << cnt << "\n";
  for (auto x : remove)
    for (auto y : mp[x]) cout << y << " ";
}
int main() {
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
