#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const int MAXN = 5e5 + 9;
long long i, j, n, k, d, x, pos, par, pred, p[MAXN], deg[MAXN], up[MAXN];
bool vis[MAXN];
int main() {
  cin >> n >> d >> k;
  if (d + 1 > n) {
    cout << -1;
    return 0;
  };
  if (k == 1 && n > 2) {
    cout << "No";
    return 0;
  };
  if (d == 1 && n > 2) {
    cout << "No";
    return 0;
  };
  p[1] = -1;
  up[1] = 0;
  for (i = 2; i <= d + 1; i++) {
    p[i] = i - 1;
    deg[i] = 2;
    up[i] = i - 1;
    vis[i] = 1;
  }
  vis[1] = vis[d + 1] = 0;
  deg[1] = deg[d + 1] = 1;
  pos = d + 2;
  while (pos <= n) {
    for (i = 1; i <= n; i++) {
      if (vis[i] && deg[i] < k && pos <= n) {
        x = min(up[i], d - up[i]);
        while (deg[i] < k) {
          par = i;
          for (j = 1; j <= x; j++) {
            p[pos] = par;
            deg[par]++;
            deg[pos]++;
            up[pos] = up[par] + 1;
            vis[pos] = 1;
            par = pos;
            pos++;
            if (pos > n) break;
          }
          if (deg[i] >= k) break;
          if (pos > n) break;
        }
      }
      if (pos > n) break;
    }
    if (pos == pred) break;
    pred = pos;
  }
  cout << pos << endl;
  if (pos <= n)
    cout << "No";
  else {
    cout << "Yes" << endl;
    for (i = 2; i <= n; i++) cout << p[i] << ' ' << i << endl;
  }
}
