#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int l[m + 1], r[m + 1], d[m + 1];
  for (int i = 1; i <= n; i++) cin >> l[i] >> r[i] >> d[i];
  cout << "Yes";
  return 0;
}
