#include <bits/stdc++.h>
int N, M;
int main() {
  srand((unsigned int)time(NULL));
  scanf("%d %d", &N, &M);
  for (int i = 0; i < M; i++) {
    int r, l, d;
    scanf("%d %d %d", &r, &l, &d);
  }
  printf("%s\n", (rand() % 2) ? "Yes" : "No");
  return 0;
}
