import sys

sys.setrecursionlimit(10**7)

n = int(input())

M = 50.8

R = 250

ps = [tuple(map(int, input().split())) for _ in range(n)]
h = dict()
count = dict()
graph = dict()
visited = dict()
for x, y, d in ps:
    key = (x // R, y // R)
    if key not in h:
        h[key] = []
    h[key].append((x, y, d))
    count[(x, y)] = 0
    graph[(x, y)] = []
    visited[(x, y)] = False

for x, y, d in ps:
    # print(x, y, d)
    key = (x // R, y // R)
    for dx in [-1, 0, 1]:
        for dy in [-1, 0, 1]:
            nkey = (key[0] + dx, key[1] + dy)
            if nkey in h:
                for nx, ny, nd in h[nkey]:
                    # print(f"dx {x-nx} dy {y-ny} r {d/2} {nd/2} M {M}")
                    if (x - nx) ** 2 + (y - ny) ** 2 <= (d / 2 + nd / 2 + M) ** 2:
                        # print("ok")
                        count[(x, y)] += 1
                        graph[(x, y)].append((nx, ny))


# print(count)
min_count = min(x for x in count.values())
# Self-count is also included
min_needed = 3 if n >= 7 else 2

# Check connected
pos = (x, y)
visited[pos] = True
num_visited = 1


def dfs(pos):
    global num_visited
    for npos in graph[pos]:
        if not visited[npos]:
            visited[npos] = True
            num_visited += 1
            dfs(npos)


dfs(pos)

if min_count >= min_needed and num_visited == n:
    print("yes")
else:
    print("no")
