import java.io.PrintWriter; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int q = sc.nextInt(); int k = sc.nextInt(); sc.close(); int q2 = q + 2; if (q2 <= 7) { int min = q2 / 4 * 2 + Math.min(q2 % 4, 2); if (min <= k) { PrintWriter pw = new PrintWriter(System.out); pw.println("Yes"); for (int i = 0; i < q; i++) { if (i % 4 < 2) { pw.println("1 2"); } else { pw.println("3 4"); } } pw.flush(); } else { System.out.println("No"); } } else { // PrintWriter pw = new PrintWriter(System.out); // pw.println("Yes"); // pw.println("1 2"); // pw.println("1 2"); // pw.println("3 4"); // pw.println("4 5"); // pw.println("4 5"); // for (int i = 5; i < q; i++) { // pw.println("6 7"); // } // pw.flush(); throw new RuntimeException(); } } }