program railway(input,output);
var
c,s,r,o,d,n,i,j:longint;
a:array[1..60001]of longint;
k:boolean;
f1,f2:text;
begin
assign(f1,'railway.in');
reset(f1);
assign(f2,'railway.out');
rewrite(f2);
readln(f1,c,s,r);
for i:=1 to c do
a[i]:=s;
for i:=1 to r do
begin
readln(f1,o,d,n);
k:=true;
for j:=o to d do
if a[j]<n then k:=false;
if k then
begin
writeln(f2,'YES');
for j:=o to d do
a[j]:=a[j]-n;
end
else writeln(f2,'NO');
end;
close(f1);
close(f2);
end.