#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, i;
  cin >> N >> M;
  int R[M], L[M], D[M];
  for (i = 0; i < N; i++) {
    cin >> R[i] >> L[i] >> D[i];
  }
  cout << "Yes" << endl;
}
