def consistent(arcs):
    for (u, v), d in arcs.items():
        for w in range(u + 1, v):
            if (u, w) in arcs and (w, v) in arcs:
                if arcs[u, w] + arcs[w, v] != d:
                    return False
    return True


def solve():
    N, M = map(int, input().split())
    arcs = {}
    for _ in range(M):
        l, r, d = tuple(map(int, input().split()))
        if l >= r:
            return False
        arcs[l, r] = d

    return consistent(arcs)


if solve():
    print('Yes')
else:
    print('No')