h, w = map(int,input().split()) a, si, sj = map(int,input().split()) b, gi, gj = map(int,input().split()) m = [list(input()) for i in range(h)] maxsize = 1200 visited = [[[False] * maxsize for i in range(w)] for j in range(h)] qi = [] qj = [] qsize = [] visited[si][sj][a] = True qi.append(si) qj.append(sj) qsize.append(a) dx = [0, 1, 0,-1] dy = [1, 0,-1, 0] while len(qsize): curi = qi.pop(0) curj = qj.pop(0) cursize = qsize.pop(0) #print(cursize,curi, curj) for i in range(4): nexti = curi + dx[i] nextj = curj + dy[i] if 0 <= nexti < h and 0 <= nextj < w: pass else: continue if m[nexti][nextj] == "*": nextsize = cursize + 1 else: nextsize = cursize - 1 if 0 < nextsize < maxsize: pass else: continue if not visited[nexti][nextj][nextsize]: visited[nexti][nextj][nextsize] = True qi.append(nexti) qj.append(nextj) qsize.append(nextsize) if visited[gi][gj][b]: print("Yes") else: print("No")