#include <iostream>

using namespace std;

#define MAX_N 100000

int d[MAX_N + 1][MAX_N + 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]) {
//                cout << "OK" << endl;
                d[L[i]][R[i]] = D[i];
            } else {
//                cout << "notOK" << endl;
                exist = false;
                break;
            }
        }
    }

    if (exist) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}