Let us define "Compare-and-Set" operation for a global variable v. The operation checks if the variable is equal to a. If that's true, the variable value changes to b and the operation succeeds. Otherwise, the variable doesn't change and the operation fails. Let us denote the operation as CAS(a,b).
Imagine that you are given a list of such operations CAS(a_1,b_1),…,CAS(a_n,b_n). Also, you are given an initial value for the variable, c, and a list of wishes w_1,…w_n, where w_i tells whether the operation CAS(a_i,b_i) should be successful. Your task is to determine the order of operations execution so that all the wishes are satisfied.
The first line contains two integers n and c (1≤n≤105; 1≤c≤109) --- the number of operations and the initial value of the variable.
Each of the next n lines contains three integers a_i,b_i,w_i (1≤a_i,b_i≤109; 0≤w_i≤1), denoting CAS(a_i,b_i) operation that you wish to be successful if w_i=1 and unsuccessful if w_i=0. The operations are numbered from 1 to n in order of input.
If no correct order of operations exists, output a single word "No".
Otherwise, output a word "Yes" followed by n distinct integers p_1,p_2,…p_n (1≤p_i≤n), meaning that operation p_1 should be executed first, then operation p_2, and so on. If there are several possible orders, output any of them.