#include <bits/stdc++.h>
using namespace std;
int d[10000 + 1][10000 + 1];
int main(void) {
  int N, M;
  cin >> N >> M;
  int L[M], R[M], D[M];
  for (int i = 0; i < M; ++i) {
    cin >> L[i] >> R[i] >> D[i];
  }
  bool exist = true;
  for (int i = 0; i < M; ++i) {
    if (abs(R[i] - L[i]) == 1) {
      d[L[i]][R[i]] = D[i];
    } else {
      int sum = 0;
      for (int j = L[i]; j < R[i]; ++j) {
        sum += d[j][j + 1];
      }
      if (sum == D[i]) {
        d[L[i]][R[i]] = D[i];
      } else {
        exist = false;
        break;
      }
    }
  }
  if (exist)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
