#include<iostream>
#include<queue>
using namespace std;
int T,M,N,k,sx,sy,ex,ey;
char map[101][101];
bool f[101][101];
int dir[4][2] = {1,0,-1,0,0,1,0,-1};
struct node
{
int x,y;
int step;
}s,e;
queue<node>q;
void init()
{
memset(f,false ,sizeof(f));
while(!q.empty())
q.pop();
memset(map,0,sizeof(map));
}
bool is_ok(int x, int y)
{
if(x>=1 && x<=M && y>=1 && y<=N && map[x][y] == '.')
return true;
return false;
}
void BFS()
{
if(sx == ex && sy == ey)
{
cout<<"yes"<<endl;
return ;
}
f[sx][sy] = true;
s.x = sx; s.y = sy ; s.step = -1;
q.push(s);
while(!q.empty())
{
s = q.front();
q.pop();
for(int i=0;i<4;i++)
{
int xx = s.x + dir[i][0];
int yy = s.y + dir[i][1];
while(is_ok(xx,yy))
{
if(f[xx][yy]==false)
{
f[xx][yy] = true;
e.x = xx;
e.y = yy;
e.step = s.step+1;
q.push(e);
if(e.x == ex && e.y == ey && e.step <=k)
{
cout<<"yes"<<endl;
return ;
}
}
xx += dir[i][0];
yy += dir[i][1];
}
}
}
cout<<"no"<<endl;
return ;
}
int main()
{
int i,j;
freopen("D:\\input.txt","r",stdin);
cin>>T;
while(T--)
{
init();
cin>>M>>N;
for(i=1;i<=M;i++)
for(j=1;j<=N;j++)
{
cin>>map[i][j];
}
cin>>k>>sy>>sx>>ey>>ex;
BFS();
}
return 0;
}