n = input()
x = 0
y = 0
for i in range(n):
    t, X, Y = map(int, input().split())
    if X == x + 1 or X == x - 1:
        if Y == y + 1 or Y == y - 1:
            x = X
            y = Y
        else:
            print("No")
    else:
        print("No")
print("Yes")