#include <bits/stdc++.h>
using namespace std;
int arr[100005], p1[100005], p2[100005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<pair<int, int> > ans;
  for (int i = 0; i < n; i++) cin >> arr[i];
  p1[0] = p2[0] = 0;
  for (int i = 0; i < n; i++) {
    if (i != 0) p1[i] += p1[i - 1];
    if (arr[i] == 1) p1[i]++;
  }
  for (int i = 0; i < n; i++) {
    if (i != 0) p2[i] += p2[i - 1];
    if (arr[i] == 2) p2[i]++;
  }
  int maxi = max(p1[n - 1], p2[n - 1]);
  for (int i = 1; i <= maxi; i++) {
    int pre1 = 0, pre2 = 0, c1 = 0, c2 = 0, x1, x2;
    while (true) {
      x1 = lower_bound(p1, p1 + n, pre1 + i) - p1;
      x2 = lower_bound(p2, p2 + n, pre2 + i) - p2;
      int idx = min(x1, x2);
      if (idx == n) break;
      if (idx == x1)
        c1++;
      else
        c2++;
      pre1 = p1[idx];
      pre2 = p2[idx];
      if (idx == n - 1) {
        if (x2 == n && c1 > c2)
          ans.push_back(make_pair(c1, i));
        else if (x1 == n && c1 < c2)
          ans.push_back(make_pair(c2, i));
      }
    }
  }
  cout << (int)ans.size() << "\n";
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++)
    cout << ans[i].first << " " << ans[i].second << "\n";
  return 0;
}
