#include using namespace std; #define rep(i,a,b) for(int i=a;i arr[my][mx]){ if(dfs(tx,ty)) return true; } } return false; } signed main(){ std::ios::sync_with_stdio(false); std::cin.tie(0); cin >> h >> w >> sx >> sy >> gx >> gy; sx--; sy--; gx--; gy--; rep(i,0,h){ rep(j,0,w){ char t; cin >> t; arr[i][j] = ctoi(t); visited[i][j] = 0; } } if(dfs(sy,sx)){ cout << "YES" << endl; }else{ cout << "NO" << endl; } }