# python template for atcoder1

import sys



N, A, B, C, D = list(map(int, input().split()))

L = list([v for v in eval(input())])



HOP = [1, 2]

dp_d = [0]*N

dp_d[B-1] = 1

for i in range(N):

    if L[i] == "#":

        continue

    for h in HOP:

        dst = i+h

        if dst < N and L[dst] == ".":

            dp_d[dst] = max(dp_d[dst], dp_d[i])

dp_c = [0]*N

dp_c[A-1] = 1

for i in range(N):

    if L[i] == "#":

        continue

    for h in HOP:

        dst = i+h

        if dst < N and L[dst] == ".":

            dp_c[dst] = max(dp_c[dst], dp_c[i])

reachable = False

if dp_c[C-1] == 1 and dp_d[D-1] == 1:

    reachable = True



if not reachable:

    print("No")

elif C < D:

    print("Yes")

else:

    if "..." in "".join(L[B-2:min(C, D)+1]):

        print("Yes")

    else:

        print("No")

# python template for atcoder1

import sys



N, A, B, C, D = [int(x)-1 for x in input().split()]

L = eval(input())



reachable = True

if "##" in L[A:C+1] or "##" in L[B:D+1]:

    reachable = False



if not reachable:

    print("No")

elif C < D:

    print("Yes")

else:

    if "..." in L[B-1:D+2]:

        print("Yes")

    else:

        print("No")

# python template for atcoder1
import sys

N, A, B, C, D = list(map(int, input().split()))
L = list([v for v in eval(input())])
HOP = [1, 2]
dp_d = [0] * N
dp_d[B - 1] = 1
for i in range(N):
    if L[i] == "#":
        continue
    for h in HOP:
        dst = i + h
        if dst < N and L[dst] == ".":
            dp_d[dst] = max(dp_d[dst], dp_d[i])
dp_c = [0] * N
dp_c[A - 1] = 1
for i in range(N):
    if L[i] == "#":
        continue
    for h in HOP:
        dst = i + h
        if dst < N and L[dst] == ".":
            dp_c[dst] = max(dp_c[dst], dp_c[i])
reachable = False
if dp_c[C - 1] == 1 and dp_d[D - 1] == 1:
    reachable = True
if not reachable:
    print("No")
elif C < D:
    print("Yes")
else:
    if "..." in "".join(L[B - 2 : min(C, D) + 1]):
        print("Yes")
    else:
        print("No")

# python template for atcoder1
import sys

N, A, B, C, D = [int(x) - 1 for x in input().split()]
L = eval(input())
reachable = True
if "##" in L[A : C + 1] or "##" in L[B : D + 1]:
    reachable = False
if not reachable:
    print("No")
elif C < D:
    print("Yes")
else:
    if "..." in L[B - 1 : D + 2]:
        print("Yes")
    else:
        print("No")

-N, A, B, C, D = list(map(int, input().split())) -L = list([v for v in eval(input())]) -HOP = [1, 2] -dp_d = [0] * N -dp_d[B - 1] = 1 -for i in range(N): -    if L[i] == "#": -        continue -    for h in HOP: -        dst = i + h -        if dst < N and L[dst] == ".": -            dp_d[dst] = max(dp_d[dst], dp_d[i]) -dp_c = [0] * N -dp_c[A - 1] = 1 -for i in range(N): -    if L[i] == "#": -        continue -    for h in HOP: -        dst = i + h -        if dst < N and L[dst] == ".": -            dp_c[dst] = max(dp_c[dst], dp_c[i]) -reachable = False -if dp_c[C - 1] == 1 and dp_d[D - 1] == 1: -    reachable = True +N, A, B, C, D = [int(x) - 1 for x in input().split()] +L = eval(input()) +reachable = True +if "##" in L[A : C + 1] or "##" in L[B : D + 1]: +    reachable = False -    if "..." in "".join(L[B - 2 : min(C, D) + 1]): +    if "..." in L[B - 1 : D + 2]: