#include <bits/stdc++.h>
using namespace std;
vector<long long int> oo, hh, ppow, anss;
long long int p = 109, modd = 1e9 + 7;
inline long long int gethash(long long int l, long long int r) {
  return (modd + hh[r] - hh[l - 1] * ppow[r - l + 1] % modd) % modd;
}
signed main() {
  long long int n;
  cin >> n;
  long long int l = 0;
  for (long long int i = 0; i < n; i++) {
    long long int x;
    cin >> x;
    oo.push_back(x - l);
    l = x;
  }
  ppow.push_back(1);
  for (long long int i = 0; i < n; i++) ppow.push_back(ppow.back() * p % modd);
  hh.push_back(0);
  for (long long int i = 0; i < n; i++)
    hh.push_back((hh.back() * p + oo[i]) % modd);
  long long int ans = 0;
  for (long long int i = n - 1; i >= 0; i--)
    if (gethash(1, i) == gethash(n - i + 1, n)) {
      anss.push_back(n - i);
    }
  cout << anss.size() << endl;
  for (auto i : anss) cout << i << " ";
  cout << endl;
}
