#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  unsigned long long T, n, m;
  cin >> n;
  vector<long long> a(n, 0);
  vector<long long> answer;
  vector<long long> dup(1000006, 0);
  unsigned long long total_sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    dup[a[i]]++;
    total_sum += a[i];
  }
  for (int i = 0; i < n; i++) {
    unsigned long long cur_sum = total_sum - a[i];
    if (cur_sum % 2 == 1) continue;
    cur_sum /= 2;
    if (cur_sum > 1000000) continue;
    if (cur_sum == a[i] && dup[a[i]] > 1) {
      answer.push_back(i);
    } else if (cur_sum != a[i] && dup[cur_sum] >= 1) {
      answer.push_back(i);
    }
  }
  cout << answer.size() << endl;
  for (unsigned long long ca : answer) cout << (ca + 1) << " ";
  return 0;
}
