#include <bits/stdc++.h>
using namespace std;
const int maxn = 2 * 1e5 + 5;
int n, a[maxn], f1[maxn], f2[maxn], first[maxn], d = 0;
long long t = 0;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    t += a[i];
    if (i == 1)
      f1[1] = a[1];
    else
      f1[i] = max(f1[i - 1], a[i]);
  }
  if (n == 2) {
    cout << 0;
    return 0;
  }
  f2[n] = a[n];
  for (int i = n - 1; i >= 1; i--) f2[i] = max(f2[i + 1], a[i]);
  for (int i = 1; i <= n; i++) {
    long long p = t - a[i], maxx;
    if (i == 1) {
      maxx = f2[2];
      if (p % maxx == 0 && p / maxx == 2) {
        d++;
        first[d] = i;
      }
    }
    if (i == n) {
      maxx = f1[n - 1];
      if (p % maxx == 0 && p / maxx == 2) {
        d++;
        first[d] = i;
      }
    }
    if (i > 1 && i < n) {
      maxx = max(f1[i - 1], f2[i + 1]);
      if (p % maxx == 0 && p / maxx == 2) {
        d++;
        first[d] = i;
      }
    }
  }
  cout << d << '\n';
  for (int i = 1; i <= d; i++) cout << first[i] << ' ';
  return 0;
}
