#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n, p[111111];
set<pair<int, int> > ans;
int main() {
  scanf("%d", &n);
  int k = 0;
  for (int i = 1; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    if (x == 1) p[i]++;
    p[i] += p[i - 1];
  }
  for (int i = 1; i <= n; ++i) {
    int first = 1, second = 0, sa = 0, sb = 0;
    bool good = true;
    while (first <= n) {
      int l = first, r = n, res = n;
      while (l <= r) {
        int m = (l + r) / 2;
        int A = p[m] - p[first - 1], B = m - first + 1 - A;
        if (max(A, B) >= i) {
          r = m - 1;
          res = m;
        } else
          l = m + 1;
      }
      int A = p[res] - p[first - 1], B = res - first + 1 - A;
      if (A == i && B != i)
        sa++;
      else if (B == i && A != i)
        sb++;
      else {
        good = false;
        break;
      }
      first = res + 1;
    }
    if (!good || sa == sb || (sa > sb && p[n] == p[n - 1]) ||
        (sb > sa && p[n] != p[n - 1]))
      continue;
    ans.insert(make_pair(max(sa, sb), i));
  }
  cout << int((ans).size()) << endl;
  for (set<pair<int, int> >::iterator it = ans.begin(); it != ans.end(); ++it)
    printf("%d %d\n", (*it).first, (*it).second);
  return 0;
}
