n, k = map(int, input().split()) if k == 1 or k == n - 1: print("No") else: print("Yes") edges = [] # Construct a chain with a negative edge in the middle # Middle edge is at position k, with value -(k+1) # Other edges are 1 # This works for the sample case and similar configurations for i in range(1, n): if i == k: edges.append((i, i+1, -(k + 1))) else: edges.append((i, i+1, 1)) # Check if the total sum is positive total = sum(w for u, v, w in edges) if total <= 0: # Adjust the first and last edges to ensure total sum is positive # For example, set them to 2 instead of 1 edges = [] for i in range(1, n): if i == k: edges.append((i, i+1, -(k + 1))) else: edges.append((i, i+1, 2)) # Output the edges for u, v, w in edges: print(u, v, w)