#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[200005];
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long(i) = (1); (i) <= (n); (i)++) cin >> a[i];
  long long mx = 0, sum = 0;
  for (long long(i) = (1); (i) <= (n); (i)++) mx = max(mx, a[i]), sum += a[i];
  long long l = 1e18, r = -1e18;
  for (long long(i) = (1); (i) <= (n); (i)++) {
    if (a[i] == mx) l = min(l, i), r = max(r, i);
  }
  vector<long long> vec;
  for (long long(i) = (1); (i) <= (n); (i)++) {
    if (l == r && i == l) continue;
    if (sum - a[i] == mx * 2) vec.push_back(i);
  }
  if (l == r) {
    sum -= a[l], mx = 0;
    for (long long(i) = (1); (i) <= (n); (i)++) {
      if (i == l) continue;
      mx = max(mx, a[i]);
    }
    if (mx * 2 == sum) vec.push_back(l);
  }
  cout << vec.size() << endl;
  for (auto x : vec) cout << x << " ";
  cout << endl;
  return 0;
}
