#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
vector<int> pos_indicator[1000004];
int main() {
  long long n, sum = 0;
  cin >> n;
  vector<long long> a(n), ans;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    pos_indicator[a[i]].push_back(i + 1);
    sum += a[i];
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) {
    if (i + 1 != n && sum - a[i] - a[n - 1] == a[n - 1]) {
      for (int j = 0; j < pos_indicator[a[i]].size(); j++)
        ans.push_back(pos_indicator[a[i]][j]);
      pos_indicator[a[i]].clear();
    } else if (i == n - 1 && sum - a[i] - a[i - 1] == a[i - 1]) {
      for (int j = 0; j < pos_indicator[a[i]].size(); j++)
        ans.push_back(pos_indicator[a[i]][j]);
    }
  }
  cout << ans.size() << '\n';
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i] << " \n"[i == ans.size() - 1];
  return 0;
}
