#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
#pragma warning(disable : 6031)
void IO() { ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); }
const int N = (int)2e5 + 5;
int a[N], cnt[(int)1e6];
vector<int> idx;
int main() {
  IO();
  int n;
  cin >> n;
  long long sum = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
    sum += a[i];
  }
  for (int i = 1; i <= n; i++) {
    sum -= a[i];
    cnt[a[i]]--;
    if ((!(sum & 1)) && sum / 2 <= 1e6 && cnt[sum / 2] > 0) idx.push_back(i);
    sum += a[i];
    cnt[a[i]]++;
  }
  cout << idx.size() << '\n';
  for (auto it : idx) cout << it << " ";
}
