import java.util.*;
import java.io.*;

//import java.math.*;

public class magicbox_sp implements Runnable {
	public static void main(String[] args) {
		new Thread(new magicbox_sp()).start();
	}

	@Override
	public void run() {
		try {
			br = new BufferedReader(new FileReader(FNAME + ".in"));
			out = new PrintWriter(FNAME + ".out");
			solve();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	boolean eof = false;

	String nextToken() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				eof = true;
				return "0";
			}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(nextToken());
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	long nextLong() {
		return Long.parseLong(nextToken());
	}

	private final String FNAME = "magicbox";
	
	class Segment implements Comparable<Segment> {
		double l, r;
		
		Segment(double a, double b) {
			l = a;
			r = b;
		}

		@Override
		public int compareTo(Segment o) {
			return Double.compare(l, o.l);
		}
	}
	
	double eps = 1e-9;
	
	int MAXN = 100000;
	int MAX = (int) 1e9;
	
	void solve() {
		int n = nextInt();
		assert(0 <= n && n <= MAXN);
		int d = nextInt();
		assert(1 <= d && d <= MAX);
		int l = nextInt();
		assert(1 <= l && l <= MAX);
		Segment[] s = new Segment[n];
		HashSet<String> hs = new HashSet<String>();
		for (int i = 0; i < n; i++) {
			String ss = nextToken();
			assert(!hs.contains(ss));
			hs.add(ss);
			assert("F".equals(ss) || "U".equals(ss));
			int x = nextInt();
			assert(0 <= x && x <= l);
			int y = nextInt();
			assert(0 <= y && y <= d);
			double r = d / 2.0;
			double a = Math.abs(r - y);
			double z = Math.sqrt(r * r - a * a);
			s[i] = new Segment(x - z, x + z);
		}
		Arrays.sort(s);
		double max = d / 2.0;
		for (int i = 0; i < n; i++) {
			if (s[i].l > max - eps) {
				out.println("YES");
				return;
			}
			max = Math.max(max, s[i].r);
		}
		if (max - eps < l - d / 2.0) {
			out.println("YES");
		} else {
			out.println("NO");
		}
	}
}
