var
  n, m, k, time, i, t, l, a, last : integer;
  fork, knife : array[0..20000] of integer;
begin
  reset(input, 'knifenfork.in');
  rewrite(output, 'knifenfork.out');
  read(n, m, k);
  assert((1 <= n) and (n <= 1000));
  assert((1 <= m) and (m <= 1000));
  assert((1 <= k) and (k <= 1000));
  time := 0;
  last := 0;
  for i := 1 to k do begin
    read(t, l, a);
    assert((last < t) and (t <= 10000));
    last := t;
    assert((1 <= l) and (l <= 10000));
    assert((0 <= a) and (a <= 1));
    while (time < t) do begin
      n := n + fork[time];
      m := m + knife[time];
      time := time + 1;
    end;
    if a = 0 then begin
      if (n < 1) then begin
        writeln('No');
      end else begin
        writeln('Yes');
        n := n - 1;
        fork[t + l] := fork[t + l] + 1;
      end;
    end else begin
      if (n < 1) or (m < 1) then begin
        writeln('No');
      end else begin
        writeln('Yes');
        n := n - 1;
        m := m - 1;
        fork[t + l] := fork[t + l] + 1;
        knife[t + l] := knife[t + l] + 1;
      end;
    end;
  end;
end.