#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const double pi = 3.14159265359;
const double eps = 1e-9;
const int mod = 1e9 + 7;
const int mod1 = 1e9 + 9;
const int INF = 1e9;
const long long INFLL = 2e18;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<pair<long long, long long> > a(n);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
    sum += a[i].first;
  }
  sort(a.begin(), a.end());
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    if (i < n - 1) {
      sum -= a[i].first;
      sum -= a.back().first;
      if (sum == a.back().first) ans.push_back(a[i].second + 1);
      sum += a[i].first + a.back().first;
    } else {
      sum -= a[i].first + a[i - 1].first;
      if (sum == a[i - 1].first) ans.push_back(a[i].second + 1);
      sum += a[i].first + a[i - 1].first;
    }
  }
  cout << ans.size() << endl;
  for (auto i : ans) cout << i << ' ';
  return 0;
}
