#include <bits/stdc++.h>
using namespace std;
const double pi = 2.0 * acos(0.0);
char small[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                  'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                  's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
long long int big_mod(long long int BASE, long long int POWER,
                      long long int MOD) {
  if (POWER == 0)
    return 1;
  else if (POWER % 2 == 0) {
    long long int RESULT = big_mod(BASE, POWER / 2, MOD);
    return ((RESULT % MOD) * (RESULT % MOD)) % MOD;
  } else
    return ((BASE % MOD) * (big_mod(BASE, POWER - 1, MOD) % MOD)) % MOD;
}
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  int a[n], b[n];
  long long int sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[i] = a[i];
    sum += a[i];
  }
  sort(b, b + n);
  long long int p = sum - b[n - 1];
  long long int q = sum - b[n - 2];
  vector<int> v;
  for (int i = 0; i < n; i++) {
    if (p - a[i] == b[n - 1] && (a[i] != b[n - 1] || b[n - 1] == b[n - 2]))
      v.push_back(i + 1);
    else if (q - a[i] == b[n - 2] &&
             (a[i] != b[n - 2] || (b[n - 2] == b[n - 3] && n - 3 >= 0) ||
              b[n - 2] == b[n - 1]))
      v.push_back(i + 1);
  }
  cout << v.size() << endl;
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
}
