------
## 最终结论
```python
def can_satisfy_all_customers(test_cases):
    results = []
    for n, m, customers in test_cases:
        current_time = 0
        min_temp = max_temp = m
        
        possible = True
        for t_i, l_i, h_i in customers:
            time_diff = t_i - current_time
            
            # Update the possible temperature range after time_diff minutes
            min_temp -= time_diff
            max_temp += time_diff
            
            # Narrow down the range to satisfy the current customer
            min_temp = max(min_temp, l_i)
            max_temp = min(max_temp, h_i)
            
            if min_temp > max_temp:
                possible = False
                break
            
            current_time = t_i
        
        results.append("YES" if possible else "NO")
    
    return results

# Read input and prepare test cases
def main():
    import sys
    input = sys.stdin.read
    data = input().split()
    
    index = 0
    q = int(data[index])
    index += 1
    
    test_cases = []
    
    for _ in range(q):
        n, m = int(data[index]), int(data[index+1])
        index += 2
        
        customers = []
        
        for _ in range(n):
            t_i, l_i, h_i = int(data[index]), int(data[index+1]), int(data[index+2])
            customers.append((t_i, l_i, h_i))
            index += 3
        
        test_cases.append((n, m, customers))
    
    results = can_satisfy_all_customers(test_cases)
    
    for result in results:
        print(result)

if __name__ == "__main__":
    main()
```