import sys

input = sys.stdin.readline



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

S=input().strip()

S+="#####"



A-=1

B-=1

C-=1

D-=1



if C<D:

    while B!=D or  A!=C:

        #print(A,B)

        if B!=D and S[B+1]==".":

            B+=1

        elif B!=D and S[B+2]==".":

            B+=2

        elif B!=D and S[B+1]=="#" and S[B+2]=="#":

            print("No")

            sys.exit()





        if A!=C and S[A+1]==".":

            A+=1

        elif A!=C and S[A+2]==".":

            A+=2

        elif A!=C and S[A+1]=="#" and S[A+2]=="#":

            print("No")

            sys.exit()



    print("Yes")



else:

    while A<B:

            

        if S[A+1]=="." and A+1!=B:

            A+=1

        elif S[A+2]=="." and A+2!=B:

            A+=2

        elif S[A+1]=="#" and S[A+2]=="#":

            print("No")

            sys.exit()



        if A+1==B or (A+2==B and S[A+1]=="#"):

            break



    while True:

        if A+1==B and S[B+1]==".":

            A+=2

            break



        if S[B+1]==".":

            B+=1

        elif S[B+2]==".":

            B+=2

        else:

            print("No")

            sys.exit()



        if S[A+1]==".":

            A+=1

        elif S[A+2]==".":

            A+=2



        if B>D:

            print("No")

            sys.exit()



    

    while B!=D or  A!=C:

        

        if A!=C and S[A+1]==".":

            A+=1

        elif A!=C and S[A+2]==".":

            A+=2

        elif A!=C and S[A+1]=="#" and S[A+2]=="#":

            print("No")

            sys.exit()

            

        if B!=D and S[B+1]==".":

            B+=1

        elif B!=D and S[B+2]==".":

            B+=2

        elif B!=D and S[B+1]=="#" and S[B+2]=="#":

            print("No")

            sys.exit()









    print("Yes")

    



        

            

        

import sys

input = sys.stdin.readline



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

S=input().strip()



BLOCK=[0]*N

OPEN=[0]*N



for i in range(1,N):

    if S[i]=="#" and S[i-1]=="#":

        BLOCK[i]=1



for i in range(2,N):

    if S[i]==S[i-1]==S[i-2]==".":

        OPEN[i]=1



RIGHT_A=N-1

for i in range(A,N):

    if BLOCK[i]==1:

        RIGHT_A=i

        break



RIGHT_B=N-1

for i in range(B,N):

    if BLOCK[i]==1:

        RIGHT_B=i

        break



if C<=RIGHT_A+1 and D<=RIGHT_B+1:

    if C<D:

        print("Yes")

        sys.exit()

    if RIGHT_A==RIGHT_B:

        for j in range(B,D+1):

            if OPEN[j]==1:

                print("Yes")

                sys.exit()



        else:

            print("No")

                

    else:

      print("Yes")

else:

    print("No")

import sys

input = sys.stdin.readline
N, A, B, C, D = list(map(int, input().split()))
S = input().strip()
S += "#####"
A -= 1
B -= 1
C -= 1
D -= 1
if C < D:
    while B != D or A != C:
        # print(A,B)
        if B != D and S[B + 1] == ".":
            B += 1
        elif B != D and S[B + 2] == ".":
            B += 2
        elif B != D and S[B + 1] == "#" and S[B + 2] == "#":
            print("No")
            sys.exit()
        if A != C and S[A + 1] == ".":
            A += 1
        elif A != C and S[A + 2] == ".":
            A += 2
        elif A != C and S[A + 1] == "#" and S[A + 2] == "#":
            print("No")
            sys.exit()
    print("Yes")
else:
    while A < B:
        if S[A + 1] == "." and A + 1 != B:
            A += 1
        elif S[A + 2] == "." and A + 2 != B:
            A += 2
        elif S[A + 1] == "#" and S[A + 2] == "#":
            print("No")
            sys.exit()
        if A + 1 == B or (A + 2 == B and S[A + 1] == "#"):
            break
    while True:
        if A + 1 == B and S[B + 1] == ".":
            A += 2
            break
        if S[B + 1] == ".":
            B += 1
        elif S[B + 2] == ".":
            B += 2
        else:
            print("No")
            sys.exit()
        if S[A + 1] == ".":
            A += 1
        elif S[A + 2] == ".":
            A += 2
        if B > D:
            print("No")
            sys.exit()
    while B != D or A != C:
        if A != C and S[A + 1] == ".":
            A += 1
        elif A != C and S[A + 2] == ".":
            A += 2
        elif A != C and S[A + 1] == "#" and S[A + 2] == "#":
            print("No")
            sys.exit()
        if B != D and S[B + 1] == ".":
            B += 1
        elif B != D and S[B + 2] == ".":
            B += 2
        elif B != D and S[B + 1] == "#" and S[B + 2] == "#":
            print("No")
            sys.exit()
    print("Yes")

import sys

input = sys.stdin.readline
N, A, B, C, D = list(map(int, input().split()))
S = input().strip()
BLOCK = [0] * N
OPEN = [0] * N
for i in range(1, N):
    if S[i] == "#" and S[i - 1] == "#":
        BLOCK[i] = 1
for i in range(2, N):
    if S[i] == S[i - 1] == S[i - 2] == ".":
        OPEN[i] = 1
RIGHT_A = N - 1
for i in range(A, N):
    if BLOCK[i] == 1:
        RIGHT_A = i
        break
RIGHT_B = N - 1
for i in range(B, N):
    if BLOCK[i] == 1:
        RIGHT_B = i
        break
if C <= RIGHT_A + 1 and D <= RIGHT_B + 1:
    if C < D:
        print("Yes")
        sys.exit()
    if RIGHT_A == RIGHT_B:
        for j in range(B, D + 1):
            if OPEN[j] == 1:
                print("Yes")
                sys.exit()
        else:
            print("No")
    else:
        print("Yes")
else:
    print("No")

-S += "#####" -A -= 1 -B -= 1 -C -= 1 -D -= 1 -if C < D: -    while B != D or A != C: -        # print(A,B) -        if B != D and S[B + 1] == ".": -            B += 1 -        elif B != D and S[B + 2] == ".": -            B += 2 -        elif B != D and S[B + 1] == "#" and S[B + 2] == "#": -            print("No") -            sys.exit() -        if A != C and S[A + 1] == ".": -            A += 1 -        elif A != C and S[A + 2] == ".": -            A += 2 -        elif A != C and S[A + 1] == "#" and S[A + 2] == "#": -            print("No") -            sys.exit() -    print("Yes") -else: -    while A < B: -        if S[A + 1] == "." and A + 1 != B: -            A += 1 -        elif S[A + 2] == "." and A + 2 != B: -            A += 2 -        elif S[A + 1] == "#" and S[A + 2] == "#": -            print("No") -            sys.exit() -        if A + 1 == B or (A + 2 == B and S[A + 1] == "#"): -            break -    while True: -        if A + 1 == B and S[B + 1] == ".": -            A += 2 -            break -        if S[B + 1] == ".": -            B += 1 -        elif S[B + 2] == ".": -            B += 2 +BLOCK = [0] * N +OPEN = [0] * N +for i in range(1, N): +    if S[i] == "#" and S[i - 1] == "#": +        BLOCK[i] = 1 +for i in range(2, N): +    if S[i] == S[i - 1] == S[i - 2] == ".": +        OPEN[i] = 1 +RIGHT_A = N - 1 +for i in range(A, N): +    if BLOCK[i] == 1: +        RIGHT_A = i +        break +RIGHT_B = N - 1 +for i in range(B, N): +    if BLOCK[i] == 1: +        RIGHT_B = i +        break +if C <= RIGHT_A + 1 and D <= RIGHT_B + 1: +    if C < D: +        print("Yes") +        sys.exit() +    if RIGHT_A == RIGHT_B: +        for j in range(B, D + 1): +            if OPEN[j] == 1: +                print("Yes") +                sys.exit() -            sys.exit() -        if S[A + 1] == ".": -            A += 1 -        elif S[A + 2] == ".": -            A += 2 -        if B > D: -            print("No") -            sys.exit() -    while B != D or A != C: -        if A != C and S[A + 1] == ".": -            A += 1 -        elif A != C and S[A + 2] == ".": -            A += 2 -        elif A != C and S[A + 1] == "#" and S[A + 2] == "#": -            print("No") -            sys.exit() -        if B != D and S[B + 1] == ".": -            B += 1 -        elif B != D and S[B + 2] == ".": -            B += 2 -        elif B != D and S[B + 1] == "#" and S[B + 2] == "#": -            print("No") -            sys.exit() -    print("Yes") +    else: +        print("Yes") +else: +    print("No")