#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e6 + 7;
int a[maxn], b[maxn], c[maxn];
int main() {
  int n;
  cin >> n;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    c[i] = a[i];
    ans += a[i];
  }
  sort(a + 1, a + n + 1);
  int maxx = a[n];
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    if (c[i] == maxx) {
      ans -= a[n - 1];
      if (ans - c[i] == a[n - 1]) {
        b[sum] = i;
        sum++;
      }
      ans += a[n - 1];
    } else {
      ans -= maxx;
      if (ans - c[i] == a[n]) {
        b[sum] = i;
        sum++;
      }
      ans += maxx;
    }
  }
  cout << sum << endl;
  for (int i = 0; i < sum; i++) cout << b[i] << ' ';
  return 0;
}
