#include <bits/stdc++.h>
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
using namespace std;
long long BigMod(long long B, long long P, long long M) {
  long long R = 1;
  while (P > 0) {
    if (P % 2 == 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return R;
}
long long histogram(long long arr[], long long n) {
  stack<int> s;
  int area = 0, i = 0;
  while (i < n) {
    if (s.empty() || arr[s.top()] <= arr[i])
      s.push(i++);
    else {
      int tp = s.top();
      s.pop();
      int xx = arr[tp] * (s.empty() ? i : i - s.top() - 1);
      area = max(area, xx);
    }
  }
  while (!s.empty()) {
    int tp = s.top();
    s.pop();
    int xx = arr[tp] * (s.empty() ? i : i - s.top() - 1);
    area = max(area, xx);
  }
  return area;
}
double arr[6000];
char str[6000];
int main() {
  int n, m, k, a, b, x;
  cin >> n >> a >> b;
  if (a >= n || (((a - 2) * b) + a + 1) < n) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  for (int i = 1; i <= a; i++) {
    cout << i << " " << i + 1 << endl;
  }
  x = 2;
  for (int i = a + 2; i <= n;) {
    int cnt = 2;
    while (cnt < b && i <= n) {
      cout << x << " " << i << endl;
      i++;
      cnt++;
    }
    x++;
  }
}
