#include <cstdio>
#include <iostream>
#include <vector>
#include <cmath>
#include <assert.h>
#include <string>
#include <algorithm>

using namespace std;

long long sqr(long long a)
{
	return a * a;
}

int main()
{
    freopen("magicbox.in", "r", stdin);
    freopen("magicbox.out", "w", stdout);
    int n;
    long long L, D;
    cin >> n >> D >> L;
	L *= 2;
	D *= 2;
    vector< pair<long long, long long> > seg;
	seg.push_back(make_pair(L, D / 2));
	seg.push_back(make_pair(0, D / 2));
    for (int i = 0; i < n; i++)
	{
		string s;
		long long x, y;
		cin >> s >> x >> y;
		x *= 2; y *= 2;
		long long len = (y * D - y * y);
		seg.push_back(make_pair(x, len));
	}
	sort(seg.begin(), seg.end());
	bool ans = false;
	for (int i = 1; i < seg.size() - 1; i++)
	{
		while (i + 1 < seg.size() && seg[i].first == seg[i + 1].first) i++;
		int t = i + 1;
		while (t + 1 < seg.size() && seg[t].first == seg[t + 1].first) t++;
		if (sqr(seg[i].first - seg[t].first) >= (seg[i].second + seg[t].second)) 
			ans = true;
	}

	if (ans) cout << "YES\n";
	else cout << "NO\n";
	
}
 