#include #include #include using namespace std; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; char str[100][100]; int bfs[52][52][12100]; int main(){ int a,b;scanf("%d%d",&a,&b); int c,d,e,f,g,h; scanf("%d%d%d%d%d%d",&c,&d,&e,&f,&g,&h); for(int i=0;i,int> > Q; Q.push(make_pair(make_pair(d,e),c)); while(Q.size()){ int row=Q.front().first.first; int col=Q.front().first.second; int yu=Q.front().second; Q.pop(); for(int i=0;i<4;i++){ int tr=row+dx[i];int tc=col+dy[i]; int ty=yu; if(tr<0||tc<0||tr>=a||tc>=b)continue; if(str[tr][tc]=='*')ty++; else ty--; if(ty<0||ty>=12100)continue; if(bfs[tr][tc][ty])continue; bfs[tr][tc][ty]=1; Q.push(make_pair(make_pair(tr,tc),ty)); } } if(bfs[g][h][f])printf("Yes\n");else printf("No\n"); }