#include <bits/stdc++.h>
using namespace std;
int n;
int arr[2 * 100010], cnt[1000010] = {0};
long long sum = 0;
vector<int> ans;
int main() {
  cin.tie(0), ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    sum += arr[i];
    ++cnt[arr[i]];
  }
  for (int i = 0; i < n; ++i) {
    sum -= arr[i];
    --cnt[arr[i]];
    if (sum % 2 == 0 && sum / 2 <= 1000000 && cnt[sum / 2]) {
      ans.push_back(i);
    }
    ++cnt[arr[i]];
    sum += arr[i];
  }
  cout << ans.size() << "\n";
  for (int i = 0; i < ans.size(); ++i) {
    if (i) cout << " ";
    cout << ans[i] + 1;
  }
}
