using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); public static void Main() { Solve(); } static void Solve() { var c = NList; var (q, k) = (c[0], c[1]); var ans = Nand(q, k); if (ans == null) { WriteLine("No"); } else { WriteLine("Yes"); WriteLine(string.Join("\n", ans)); } } static List Nand(int q, int k) { var ans = new List { "1 2", "2 3", "1 4", "1 5", "1 5" }; if (q == 1) { } else if (q == 2) { if (k < 3) return null; } else if (q == 3) { if (k < 3) return null; } else if (q == 4) { if (k < 4) return null; } else { if (k < 4) return null; if (k == 4) { return new List { "1 2", "2 3", "1 4", "1 4", "5 6" }; } for (var i = 5; i < q; ++i) ans.Add("6 7"); } return ans.Take(q).ToList(); } }