#緑以下H def move(s): if s=='R': return (1,0) if s=='L': return (-1,0) if s=='U': return (0,1) if s=='D': return (0,-1) for _ in range(int(input())): x1,y1,d1 = input().split() x2,y2,d2 = input().split() x1,y1,x2,y2 = map(int,[x1,y1,x2,y2]) x1,y1,x2,y2 = x1*2, y1*2, x2*2, y2*2 hantei = 0 #x軸・y軸の距離差のうち、半分くらいのものと長い方で衝突判定 for t in [abs(x1-x2)//2, abs(x1-x2)//2+1, abs(y1-y2)//2, \ abs(y1-y2)//2+1, abs(x1-x2), abs(y1-y2)]: way = move(d1) wx,wy = way[0]*t, way[1]*t newx1 = x1 + wx newy1 = y1 + wy way = move(d2) wx,wy = way[0]*t, way[1]*t newx2 = x2 + wx newy2 = y2 + wy if newx1 == newx2 and newy1 == newy2: hantei = 1 print('Yes' if hantei else 'No')