H, W = map(int, raw_input().split()) A, Sr, Sc = map(int, raw_input().split()) B, Gr, Gc = map(int, raw_input().split()) if (abs(Sr-Gr)+abs(Sc-Gc))%2 != abs(A-B)%2: print 'No' exit() board = [raw_input() for _ in xrange(H)] dr = [0, 0, 1, -1] dc = [1, -1, 0, 0] if board[Gr][Gc] == '*' and B == 1: for i in xrange(4): nr, nc = Gr+dr[i], Gc+dc[i] if 0 <= nr < H and 0 <= nc < W and board[nr][nc] == '*': break else: print 'No' exit() if abs(A-B) >= abs(Sr-Gr)+abs(Sc-Gc): print 'Yes' exit() goals = set() for i in xrange(H): for j in xrange(W): if (i, j) in goals: continue if board[i][j] == '.': continue for k in xrange(4): nr, nc = i+dr[k], j+dr[k] if 0 <= nr < H and 0 <= nc < W and board[nr][nc] == '*': goals.add((i, j)) goals.add((nr, nc)) reachable = {} stack = [((Sr, Sc), A)] while len(stack) > 0: node, size = stack.pop() if node in goals and size >= 1: print 'Yes' exit() if node in reachable and reachable[node] >= size: continue reachable[node] = size for i in xrange(4): nr, nc = node[0]+dr[i], node[1]+dc[i] if nr < 0 or nr >= H or nc < 0 or nc >= W: continue new_size = size + 1 if board[nr][nc] == '*' else size - 1 if new_size <= 0: continue if (nr, nc) in reachable and reachable[(nr, nc)] >= new_size: continue stack.append(((nr, nc), new_size)) print 'No'