Q,K=map(int, input().split()) A=[[0,0],[1,0],[0,1],[1,1]] C=[(0,1),(0,1),(2,3),(2,3),(4,5),(4,5),(6,7),(6,7),(8,9)] D=[] c=0 while Q: if Q>=2: D.append((c,c+1)) D.append((c,c+1)) Q-=2 else: D.append((c,c+1)) Q-=1 c+=2 for x,y in D: for i in range(4): if A[i][x]+A[i][y]==2: c=0 else: c=1 A[i].append(c) cc=0 for i in range(4): cc=max(cc,sum(A[i])) if cc<=K: print('Yes') for x,y in D: print(x+1,y+1) else: print('No')