Q,K= map(int,input().split()) Kmin = (Q-4)//2+4 if K>=Kmin: print("Yes") print(1,2) for i in range(2,Q+1): print(i-1,i+1) else: print("No")