n, m = map(int, input().split())
temp = []
ans = [0]*(n+1)
flag = False
for i in range(m):
  l, r, d = map(int, input().split())
  if ans[r] == 0:
    ans[r] = ans[r-1] + d
  temp.append([l, r, d])

for i in temp:
  left, right, d = i
  if ans[right] - ans[left] != d:
    print('No')
    flag = True
    break

if flag == False:
  print('Yes')