R=range Q,K=map(int,input().split()) if 2<=Q<=3 and K<3:print("No") elif 4<=Q<=5 and K<4:print("No") elif 6<=Q and K<5:print("No") else: print("Yes") if Q==5: for q in R(1,Q+1): if 1<=q<=2:print(1,2) elif q==3:print(3,4) elif 4<=q<=5:print(4,5) else:print(6,7) else: for q in R(1,Q+1): if 1<=q<=2:print(1,2) elif 3<=q<=4:print(3,4) else:print(5,6) #__1234567 #123456789 #001101100 #011101100 #101101100 #110011100 #122334555 #__12345 #1234567 #0011001 #0111001 #1011001 #1100110 #1223344