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

public class knifenfork_ats implements Runnable {
	public static void main(String[] args) {
		(new knifenfork_ats()).run();
	}

	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}
		return in.nextToken();
	}

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

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

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

	final int MAXTIME = (int) 1e4;
	final int MAXN = (int) 1e3;

	public void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();
		int k = nextInt();

		assert (1 <= n && n <= MAXN);
		assert (1 <= m && m <= MAXN);
		assert (1 <= k && k <= MAXN);

		int[] knives = new int[MAXTIME * 3];
		int[] forks = new int[MAXTIME * 3];
		Arrays.fill(knives, 0);
		Arrays.fill(forks, 0);

		int right = -1;
		int prev = 0;

		for (int i = 0; i < k; i++) {
			int t = nextInt();
			int l = nextInt();
			int code = nextInt();

			assert (prev < t && t <= MAXTIME);
			assert (1 <= l && l <= MAXTIME);
			assert (code == 0 || code == 1);

			while (right < t) {
				right++;
				n += forks[right];
				m += knives[right];
			}

			if (code == 0) {
				if (n > 0) {
					forks[t + l]++;
					n--;
					out.println("Yes");
				} else {
					out.println("No");
				}
			} else {
				if (n > 0 && m > 0) {
					forks[t + l]++;
					knives[t + l]++;
					m--;
					n--;
					out.println("Yes");
				} else {
					out.println("No");
				}
			}
		}
	}

	public void run() {
		try {
			Locale.setDefault(Locale.US);
			br = new BufferedReader(new FileReader("knifenfork.in"));
			out = new PrintWriter("knifenfork.out");

			solve();

			out.close();
			br.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}
