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

using namespace std;

const long double EPS = 1e-10;

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

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