import sys import io, os input = sys.stdin.readline def main(): h, w = map(int, input().split()) a, si, sj = map(int, input().split()) b, ti, tj = map(int, input().split()) M = [str(input().rstrip()) for i in range(h)] visit = [[False]*2001 for i in range(h*w)] from collections import deque q = deque([]) s = si*w+sj t = ti*w+tj q.append((s, a)) visit[s][a] = True while q: v, x = q.popleft() if v == t and x == b: break i, j = divmod(v, w) for di, dj in (-1, 0), (1, 0), (0, 1), (0, -1): ni, nj = i+di, j+dj if 0 <= ni < h and 0 <= nj < w: nv = ni*w+nj if M[ni][nj] == '*': nx = x+1 else: nx = x-1 if nx >= 1 and nx <= 2000 and not visit[nv][nx]: q.append((nv, nx)) visit[nv][nx] = True if visit[t][b]: print('Yes') else: print('No') if __name__ == '__main__': main()