#include <bits/stdc++.h>
using namespace std;
void pp(long long int arr[], long long int len) {
  for (int i = 0; i < len; i++) {
    cout << arr[i] << " ";
  }
}
void zalgo(long long int arr[], long long int res[], int n) {
  long long int l = 0, r = 0, i, k;
  res[0] = 0;
  for (i = 1; i < n; ++i) {
    if (i > r) {
      l = r = i;
      while (r < n && arr[r] == arr[r - l]) {
        r++;
      }
      res[i] = r - l;
      r--;
    } else {
      k = i - l;
      if (res[k] <= r - i) {
        res[i] = res[k];
      } else {
        l = i;
        while (r < n && arr[r] == arr[r - l]) {
          r++;
        }
        res[i] = r - l;
        r--;
      }
    }
  }
}
int main() {
  long long int n, i, sum = 0, t, mx = INT_MIN;
  cin >> n;
  long long int arr[n], prev = 0, res[n];
  vector<long long int> len;
  for (i = 0; i < n; i++) {
    cin >> t;
    arr[i] = t - prev;
    prev = t;
  }
  zalgo(arr, res, n);
  long long int rr = 1;
  for (i = 1; i < n; i++) {
    if (i + res[i] == n) {
      len.push_back(i);
      ++rr;
    }
  }
  len.push_back(i);
  cout << rr << "\n";
  for (i = 0; i < rr; i++) {
    cout << len[i] << " ";
  }
  return 0;
}
