from collections import deque H,W=map(int,input().split()) A,sx,sy=map(int,input().split()) B,gx,gy=map(int,input().split()) g=['']*H for i in range(H): g[i]=input() dist=[-1]*50*50*1500 dist[sx*50*1500+sy*1500+A]=0 que=deque([sx*50*1500+sy*1500+A]) dx=[1,0,-1,0] dy=[0,1,0,-1] while que: now=que.popleft() sz=now%1500 now//=1500 y=now%50 now//=50 x=now for i in range(4): nx=x+dx[i] ny=y+dy[i] if nx<0 or ny<0 or nx>=H or ny>=W: continue nt=sz if g[nx][ny]=='*': nt+=1 else: nt-=1 if nt>=1500 or nt<1: continue to=nx*50*1500+ny*1500+nt if dist[to]!=-1: continue dist[to]=0 que.append(to) if dist[gx*50*1500+gy*1500+B]==0: print('Yes') else: print('No')