#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  long long int a[n];
  vector<pair<long long int, long long int>> b;
  long long int mx = 0, pos = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b.push_back({a[i], i});
    if (a[i] > mx) {
      mx = a[i];
      pos = i;
    }
  }
  sort(b.begin(), b.end());
  vector<long long int> pref(n + 5, 0), suf(n + 5, 0);
  for (int i = 0; i < n; i++) {
    pref[i + 1] = pref[i] + a[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    suf[i + 1] = suf[i + 2] + a[i];
  }
  vector<long long int> ans;
  for (int i = 0; i < n; i++) {
    if (a[i] == mx) {
      if (pref[b[n - 2].second] + suf[b[n - 2].second + 2] - mx ==
          b[n - 2].first) {
        ans.push_back(i + 1);
      }
      continue;
    }
    if (pref[pos] + suf[pos + 2] - a[i] == mx) {
      ans.push_back(i + 1);
    }
  }
  cout << ((int)(ans).size()) << "\n";
  for (auto it : ans) {
    cout << it << " ";
  }
  return 0;
}
