#include <bits/stdc++.h>
using namespace std;
const int inf = 0x20202020;
const long long mod = 1000000007;
const double eps = 1e-9;
const double pi = 3.1415926535897932384626;
const int DX[] = {1, 0, -1, 0}, DY[] = {0, 1, 0, -1};
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long powmod(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
template <class X>
void debug(vector<X>& v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
}
int C[100009];
vector<pair<int, int> > V;
int bs(int lo, int hi, int lst, int strt) {
  int mid, ans = -1, won, lost;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    won = C[mid] - C[strt];
    lost = (mid - strt) - won;
    int m = max(won, lost);
    if (m == lst) {
      ans = mid;
      hi = mid - 1;
    } else if (m < lst) {
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  return ans;
}
int main() {
  int i, j, k, T, cas = 0;
  int n, a;
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a;
    C[i] = C[i - 1] + (a % 2);
  }
  int won, lost, lst = 0, ans = 0;
  for (i = 1; i <= n; i++) {
    won = C[i];
    lost = i - C[i];
    if (lst < max(won, lost) && won != lost) {
      lst = max(won, lost);
      int strt = 0;
      int s = 0, w = 0;
      bool t = 1;
      while (1) {
        if (strt == -1) {
          t = 0;
          break;
        }
        if (strt == n) {
          if ((w < (s - w) && C[n] - C[n - 1] == 0) ||
              (w > (s - w) && C[n] - C[n - 1] == 1)) {
            ans++;
            V.push_back(make_pair(max(w, s - w), lst));
          }
          break;
        }
        int ed = bs(min(strt + lst, n), min(strt + 2 * lst, n), lst, strt);
        s++;
        if ((ed - strt) - (C[ed] - C[strt]) < (C[ed] - C[strt])) w++;
        strt = ed;
      }
    }
  }
  sort((V).begin(), (V).end());
  cout << ans << endl;
  for (i = 0; i < ans; i++) {
    cout << V[i].first << " " << V[i].second << endl;
  }
  return 0;
}
