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

public class knifenfork_va implements Runnable {
    public static void main(String[] args) {
        new Thread(new knifenfork_va()).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());
    }

    public class event implements Comparable<event> {
        int time;
        int get;
        int type;
        int who;

        public event(int time, int get, int type, int who) {
            this.time = time;
            this.get = get;
            this.type = type;
            this.who = who;
        }

        public int compareTo(event o) {
            if (time != o.time)
                return time - o.time;

            return get - o.get;
        }
    }

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

        boolean[] eat = new boolean[k];
        event[] e = new event[2 * k];
        int z = 0;
        for (int i = 0; i < k; i++) {
            int time = nextInt();
            int l = nextInt();
            int type = nextInt();
            e[z++] = new event(time, 1, type, i);
            e[z++] = new event(time + l, -1, type, i);
        }

        Arrays.sort(e);

        for (int i = 0; i < e.length; i++) {
            if (e[i].get == -1 && !eat[e[i].who]) {
                continue;
            }

            if (e[i].get == -1) {
                if (e[i].type == 0) {
                    n++;
                } else {
                    n++;
                    m++;
                }
            } else {
                if (e[i].type == 0) {
                    if (n > 0) {
                        n--;
                        eat[e[i].who] = true;
                        out.println("Yes");
                    } else {
                        out.println("No");
                    }
                } else {
                    if (n * m > 0) {
                        n--;
                        m--;
                        eat[e[i].who] = true;
                        out.println("Yes");
                    } else {
                        out.println("No");
                    }
                }
            }
        }
    }

    public void run() {
        try {
            //br = new BufferedReader(new InputStreamReader(System.in));
            //out = new PrintWriter(System.out);
            br = new BufferedReader(new FileReader("knifenfork.in"));
            out = new PrintWriter("knifenfork.out");

            solve();

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