#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 1e6 + 15;
void my_dbg() { cout << endl; }
template <typename Arg, typename... Args>
void my_dbg(Arg A, Args... B) {
  cout << ' ' << A;
  my_dbg(B...);
}
bool vis[N];
int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n + 1);
  long long sum = 0;
  multiset<int, greater<int> > s;
  for (int i = 1; i < (int)n + 1; i++) {
    scanf("%d", &a[i]), sum += a[i], vis[a[i]] = 1;
    s.insert(a[i]);
  }
  vector<int> id;
  for (int i = 1; i < (int)n + 1; i++) {
    int cur = a[i];
    s.erase(s.find(a[i]));
    int mx = *s.begin();
    if (2 * mx == sum - a[i]) id.push_back(i);
    s.insert(a[i]);
  }
  printf("%d\n", (int)id.size());
  for (auto xy : id) printf("%d ", (int)xy);
  printf("\n");
  ;
}
