#include<bits/stdc++.h>
using namespace std;
#define int long long
int a[114][114],n,m,q,bpp,t1,t2,t3,t4,t5,t6,qw[5]={1,255,50625,11390625};
void resetting(int x,int y)
{
int r=0,g=0,b=0;
b=a[x][y]/qw[2];
g=(a[x][y]-b*qw[2])/qw[1];
r=(a[x][y]-b*qw[2]-g*qw[1])/qw[0];
b%=256;
g%=256;
r%=256;
a[x][y]=r*qw[0]+g*qw[1]+b*qw[2];
}
signed main()
{
scanf("%lld%lld%lld",&n,&m,&q);
for(int i=1;i<=q;++i)
{
scanf("%lld%lld%lld%lld",&t1,&t2,&t3,&t4);
t4%=256;
t5=m-t2+1;
t6=(t2<t5)?1:-1;
t2=min(t2,t5);
resetting(t1,t2);
t5=a[t1][t2];
a[t1][t2]+=t6*(t4*qw[t3-1]);
resetting(t1,t2);
if(t5==0&&a[t1][t2]!=0)
{
bpp++;
}
else if(t5!=0&&a[t1][t2]==0)bpp--;
if(bpp==0)printf("Yes\n");
else printf("No\n");
}
return 0;
}