using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; class TEST{ static void Main(){ Sol mySol =new Sol(); mySol.Solve(); } } class Sol{ public void Solve(){ memo = new bool[H,W,MaxSize]; memo[Si,Sj,A] = true; dfs(Si,Sj,A); Console.WriteLine(memo[Gi,Gj,B]?"Yes":"No"); } static int MaxSize = 1200; bool[,,] memo; static int[] dx = {1,0,-1,0}; static int[] dy = {0,-1,0,1}; void dfs(int y, int x, int sz){ for(int t=0;t<4;t++){ int ny = y + dy[t]; int nx = x + dx[t]; if(!InRange(ny,nx,H,W)) continue; int nsz = sz; if(M[ny][nx] == '.') nsz-- ; if(M[ny][nx] == '*') nsz++ ; if(nsz <=0 || nsz >= MaxSize)continue; if(!memo[ny,nx,nsz]){ memo[ny,nx,nsz] = true; dfs(ny,nx,nsz); } } } static bool InRange(int r,int c,int rmax,int cmax){ return r >= 0 && r < rmax && c >= 0 && c < cmax; } static int H,W; static String[] M; int A,Si,Sj; int B,Gi,Gj; public Sol(){ var d = ria(); H = d[0]; W = d[1]; d = ria(); A = d[0]; Si = d[1]; Sj = d[2]; d = ria(); B = d[0]; Gi = d[1]; Gj = d[2]; M = new String[H]; for(int i=0;iint.Parse(e));} static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));} static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));} }