# Include <iostream> # include <cstring> # include <string> # include <cstdio> # include <cmath> # include <algorithm> # include <vector> # include <queue> # include <map> # define INF 0x3f3f3f # define ll _ int64 # define mod 1000000007 using namespace STD; struct node {int X, Y, CNT;} Now, TMP; int DX [] = {1,-1, 0}; int dy [] = {0, 0, -110}; char MP [110] [110]; int vis [110] [], K, x1, x2, YY1, Y2, n, m; int OK (INT X, int y) {If (x> = 0 & x <n & Y> = 0 & Y <M & MP [x] [Y]! = '*') Return 1; return 0;} int BFS () {queue <node> q; now. X = x1; now. y = YY1; q. push (now); While (! Q. empty () {now = Q. front (); q. pop (); For (INT I = 0; I <4; I ++) {TMP. X = now. X + dx [I]; TMP. y = now. Y + dy [I]; while (OK (TMP. x, TMP. y) // make sure that the number of turns at the specified position is the least when the same direction is low. {If (vis [TMP. x] [TMP. y] =-1) {vis [TMP. x] [TMP. y] = vis [now. x] [now. y] + 1; if (TMP. X = X2 & TMP. y = Y2 & Vis [TMP. x] [TMP. y] <= k) return 1; q. push (TMP);} TMP. X = TMP. X + dx [I]; TMP. y = TMP. Y + dy [I] ;}}return 0 ;}int main () {int t; scanf ("% d", & T); While (t --) {scanf ("% d", & N, & M); For (INT I = 0; I <n; I ++) scanf ("% s ", MP [I]); scanf ("% d", & K, & YY1, & X1, & Y2, & x2); X1 --; x2 --; YY1 --; Y2 --; memset (VIS,-1, sizeof vis); If (BFS () printf ("Yes \ n "); else printf ("NO \ n");} return 0 ;}