h,w=map(int,input().split()) U,D,R,L,k,p=map(int,input().split()) c=[U,D,R,L] d=[(-1,0),(1,0),(0,1),(0,-1)] Sx,Sy,Gx,Gy=map(int,input().split()) Sx-=1 Sy-=1 Gx-=1 Gy-=1 s=[input() for i in range(h)] v=[[k+1]*w for i in range(h)] v[Sx][Sy]=0 q=[(v[Sx][Sy],Sx,Sy)] from heapq import heappush,heappop while len(q)>0: sc,sx,sy=heappop(q) if sc>v[sx][sy]: continue for i in range(4): dx,dy=d[i] tx,ty=sx+dx,sy+dy if 0<=txtc: v[tx][ty]=tc heappush(q,(v[tx][ty],tx,ty)) print(["No","Yes"][v[Gx][Gy]<=k])