var cas,xx,n,m,q,i,j,x,p,x1,y1,x2,y2,y,z,ans:longint; a,tree:array[1..1010,1..1010]of longint; function lowbit(x:longint):longint; begin lowbit:=x and (-x); end; procedure update(i,j,k:longint); var x:longint; begin while i<=n do begin x:=j; while x<=m do begin tree[i,x]:=tree[i,x] xor k; x:=x+lowbit(x); end; i:=i+lowbit(i); end; end; function query(i,j:longint):longint; var x:longint; begin y:=0; while i>0 do begin x:=j; while x>0 do begin y:=y xor tree[i,x]; x:=x-lowbit(x); end; i:=i-lowbit(i); end; query:=y; end; begin readln(cas); for xx:=1 to cas do begin readln(n,m,q); fillchar(Tree,sizeof(Tree),0); for i:=1 to n do begin for j:=1 to m do begin read(a[i,j]); update(i,j,a[i,j]); end; readln; end; for i:=1 to q do begin read(p); if p=1 then begin readln(x1,y1,x2,y2); if query(x1-1,y1-1) xor query(x1-1,y2) xor query(x2,y1-1) xor query(x2,y2)<>0 then writeln('Yes') else writeln('No'); end else begin readln(x,y,z); update(x,y,a[x,y] xor z); a[x,y]:=z; end; end; end; end.