#include <bits/stdc++.h>
using namespace std;
long long sum = 0;
int main() {
  int n;
  cin >> n;
  vector<int> arr(n), ind, cnt(1e6 + 1);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    cnt[arr[i]]++;
  }
  sum = accumulate(arr.begin(), arr.end(), 0ll);
  for (int i = 0; i < n; i++) {
    sum -= arr[i];
    cnt[arr[i]]--;
    if (sum % 2 == 0 && sum / 2 <= 1e6 && cnt[sum / 2] > 0) ind.push_back(i);
    sum += arr[i];
    cnt[arr[i]]++;
  }
  cout << ind.size() << endl;
  for (auto u : ind) {
    cout << u + 1 << " ";
  }
}
