#include #include using namespace std; typedef pair pii; int main(){ int h, w, sx, sy, gx ,gy; cin>> h>> w>> sx>> sy>> gx>> gy; sx--; sy--; gx--; gy--; string b[h]; for(int i=0; i> b[i]; } int fld[h][w]; for(int i=0; i Q; Q.push(pii(sx, sy)); while(!Q.empty()){ now=Q.front(); Q.pop(); if(now.first==gx&&now.second==gy){ cout<< "YES"<< endl; return 0; } visited[now.first][now.second]=1; for(pii d: dd){ ni=now.first+d.first; nj=now.second+d.second; if(!(0<=ni&&ni