import sys
input = sys.stdin.readline
sys.setrecursionlimit(250000)


def read():
    N, A, B, C, D = map(int, input().strip().split())
    S = input().strip()
    return N, A-1, B-1, C-1, D-1, S


def check_reachable(N, S, start):
    reachable = [False for s in S]
    reachable[start] = True
    
    def _bfs(x):
        for d in [1, 2]:
            nx = x + d
            if 0 <= nx < N and not reachable[nx] and S[nx] == ".":
                reachable[nx] = True
                _bfs(nx)
    
    _bfs(start)
    return reachable


def solve(N, A, B, C, D, S):
    r1 = check_reachable(N, S, A)
    r2 = check_reachable(N, S, B)
    if r1[B] and r2[D]:
        if C < D:
            return "Yes"
        else:
            for i in range(B, D+1):
                if r2[i] and 0 <= i-1 < N and 0 <= i+1 < N and r1[i-1] and r1[i+1]:
                    return "Yes"
    return "No"
        


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs)) import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline sys.setrecursionlimit(250000) sys.setrecursionlimit sys setrecursionlimit 250000 def read():
    N, A, B, C, D = map(int, input().strip().split())
    S = input().strip()
    return N, A-1, B-1, C-1, D-1, S read N, A, B, C, D = map(int, input().strip().split()) N map(int, input().strip().split()) map int input().strip().split() ().strip().split ().strip() ().strip () input strip split A B C D S = input().strip() S input().strip() ().strip () input strip return N, A-1, B-1, C-1, D-1, S return N, A-1, B-1, C-1, D-1, S N A-1 A 1 B-1 B 1 C-1 C 1 D-1 D 1 S def check_reachable(N, S, start):
    reachable = [False for s in S]
    reachable[start] = True
    
    def _bfs(x):
        for d in [1, 2]:
            nx = x + d
            if 0 <= nx < N and not reachable[nx] and S[nx] == ".":
                reachable[nx] = True
                _bfs(nx)
    
    _bfs(start)
    return reachable check_reachable False for s in S for s in S s S for s in S False reachable = [False for s in S] reachable [False for s in S] reachable[start] = True reachable[start] reachable start True def _bfs(x):
        for d in [1, 2]:
            nx = x + d
            if 0 <= nx < N and not reachable[nx] and S[nx] == ".":
                reachable[nx] = True
                _bfs(nx)
    
     _bfs for d in [1, 2]:
            nx = x + d
            if 0 <= nx < N and not reachable[nx] and S[nx] == ".":
                reachable[nx] = True
                _bfs(nx)
    
     d [1, 2] 1 2 nx = x + d nx x + d x d if 0 <= nx < N and not reachable[nx] and S[nx] == ".":
                reachable[nx] = True
                _bfs(nx)
    
     0 <= nx < N and not reachable[nx] and S[nx] == "." 0 <= nx < N and not reachable[nx] 0 <= nx < N 0 <= nx 0 nx N not reachable[nx] reachable[nx] reachable nx S[nx] == "." S[nx] S nx "." reachable[nx] = True reachable[nx] reachable nx True _bfs(nx) _bfs nx x x _bfs(start) _bfs start return reachable reachable N N S S start start def solve(N, A, B, C, D, S):
    r1 = check_reachable(N, S, A)
    r2 = check_reachable(N, S, B)
    if r1[B] and r2[D]:
        if C < D:
            return "Yes"
        else:
            for i in range(B, D+1):
                if r2[i] and 0 <= i-1 < N and 0 <= i+1 < N and r1[i-1] and r1[i+1]:
                    return "Yes"
    return "No"
         solve r1 = check_reachable(N, S, A) r1 check_reachable(N, S, A) check_reachable N S A r2 = check_reachable(N, S, B) r2 check_reachable(N, S, B) check_reachable N S B if r1[B] and r2[D]:
        if C < D:
            return "Yes"
        else:
            for i in range(B, D+1):
                if r2[i] and 0 <= i-1 < N and 0 <= i+1 < N and r1[i-1] and r1[i+1]:
                    return "Yes"
     r1[B] and r2[D] r1[B] r1 B r2[D] r2 D if C < D:
            return "Yes"
        else:
            for i in range(B, D+1):
                if r2[i] and 0 <= i-1 < N and 0 <= i+1 < N and r1[i-1] and r1[i+1]:
                    return "Yes"
     C < D C D return "Yes" "Yes" for i in range(B, D+1):
                if r2[i] and 0 <= i-1 < N and 0 <= i+1 < N and r1[i-1] and r1[i+1]:
                    return "Yes"
     i range(B, D+1) range B D+1 D 1 if r2[i] and 0 <= i-1 < N and 0 <= i+1 < N and r1[i-1] and r1[i+1]:
                    return "Yes"
     r2[i] and 0 <= i-1 < N and 0 <= i+1 < N and r1[i-1] and r1[i+1] r2[i] and 0 <= i-1 < N and 0 <= i+1 < N and r1[i-1] r2[i] and 0 <= i-1 < N and 0 <= i+1 < N r2[i] and 0 <= i-1 < N r2[i] r2 i 0 <= i-1 < N 0 <= i-1 0 i-1 i 1 N 0 <= i+1 < N 0 <= i+1 0 i+1 i 1 N r1[i-1] r1 i-1 i 1 r1[i+1] r1 i+1 i 1 return "Yes" "Yes" return "No" "No" N N A A B B C C D D S S if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs)) __name__ == '__main__' __name__ '__main__' inputs = read() inputs read() read print(solve(*inputs)) print solve(*inputs) solve *inputs inputs def check_reachable(N, S, start):
    reachable = [False for s in S]
    reachable[start] = True
    
    def _bfs(x):
        for d in [1, 2]:
            nx = x + d
            if 0 <= nx < N and not reachable[nx] and S[nx] == ".":
                reachable[nx] = True
                _bfs(nx)
    
    _bfs(start)
    return reachable def check_reachable(N, S, start):
    reachable = [False for s in S]
    reachable[start] = True
    
    def _bfs(x):
        for d in [1, 2]:
            nx = x + d
            if 0 <= nx < N and not reachable[nx] and S[nx] == ".":
                reachable[nx] = True
                _bfs(nx)
    
    _bfs(start)
    return reachable check_reachable input = sys.stdin.readline sys.stdin.readline input inputs = read() read() inputs def solve(N, A, B, C, D, S):
    r1 = check_reachable(N, S, A)
    r2 = check_reachable(N, S, B)
    if r1[B] and r2[D]:
        if C < D:
            return "Yes"
        else:
            for i in range(B, D+1):
                if r2[i] and 0 <= i-1 < N and 0 <= i+1 < N and r1[i-1] and r1[i+1]:
                    return "Yes"
    return "No"
         def solve(N, A, B, C, D, S):
    r1 = check_reachable(N, S, A)
    r2 = check_reachable(N, S, B)
    if r1[B] and r2[D]:
        if C < D:
            return "Yes"
        else:
            for i in range(B, D+1):
                if r2[i] and 0 <= i-1 < N and 0 <= i+1 < N and r1[i-1] and r1[i+1]:
                    return "Yes"
    return "No"
         solve def read():
    N, A, B, C, D = map(int, input().strip().split())
    S = input().strip()
    return N, A-1, B-1, C-1, D-1, S def read():
    N, A, B, C, D = map(int, input().strip().split())
    S = input().strip()
    return N, A-1, B-1, C-1, D-1, S read
import sys
input = sys.stdin.readline
sys.setrecursionlimit(250000)


def read():
    N, A, B, C, D = map(int, input().strip().split())
    S = input().strip()
    return N, A-1, B-1, C-1, D-1, S


def check_reachable(N, S, start):
    reachable = [False for s in S]
    reachable[start] = True
    
    def _bfs(x):
        for d in [1, 2]:
            nx = x + d
            if 0 <= nx < N and not reachable[nx] and S[nx] == ".":
                reachable[nx] = True
                _bfs(nx)
    
    _bfs(start)
    return reachable


def solve(N, A, B, C, D, S):
    r1 = check_reachable(N, S, A)
    r2 = check_reachable(N, S, B)
    if r1[B] and r2[D]:
        if C < D:
            return "Yes"
        else:
            for i in range(B, D+1):
                if r2[i] and 0 <= i-1 < N and 0 <= i+1 < N and r1[i-1] and r1[i+1]:
                    return "Yes"
    return "No"
        


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))
