n , a0 , b0 , c0 , d0 = list(map(int,input().split()))

s = eval(input())



# a < b に変換する

if a0 > b0 : # 入れ替える

    a = b0

    b = a0

    c = d0

    d = c0

else : # 入れ替えない

    a = a0

    b = b0

    c = c0

    d = d0



right = max(c,d)

left = min(a,b)

middle = max(a,b)



for i in range(n-1) :

    if s[i] == '#' and s[i+1] == '#' : # 岩が2個連続である場合

        if i <= right - 2 and i >= left - 1 :

            print('No')

            break

else :

    if c < d :

        print('Yes')

    else :

        for i in range(n-2) :

            if s[i] == '.' and s[i+1] == '.' and s[i+2] == '.' : # 入れ替え可能

                if i + 1 == b - 1 :

                    print('Yes')

                    break

                if i <= d - 2 and i >= b - 1 :

                    print('Yes')

                    break

        else :

            print('No')

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

S = '$' + eval(input()) + '$'



def isOk(fr, to):

    if S[fr: to + 1].count('##') > 0:

        return False

    return True



if not (isOk(A, C) and isOk(C, D)):

    print('No')

    exit()



def canSwitch():

    if A + 1 == B and D < C and S[A: A + 3] == '...':

        return True

    if B + 1 == A and C < D and S[B: B + 3] == '...':

        return True

    if C + 1 == D and B < A and S[C - 1: D + 1] == '...':

        return True

    if D + 1 == C and A < B and S[D - 1: C + 1] == '...':

        return True

    if A < B and S[B - 1: B + 2] == '...':

        return True

    if B < A and S[A - 1: A + 2] == '...':

        return True

    if C < D and S[C - 1: C + 2] == '...':

        return True

    if D < C and S[D - 1: D + 2] == '...':

        return True

    if S[max(A, B): min(C, D) + 1].count('...'):

        return True

    return False



if A < B and D < C or B < A and C < D:

    if not canSwitch():

        print('No')

        exit()



print('Yes')

n, a0, b0, c0, d0 = list(map(int, input().split()))
s = eval(input())
# a < b に変換する
if a0 > b0:  # 入れ替える
    a = b0
    b = a0
    c = d0
    d = c0
else:  # 入れ替えない
    a = a0
    b = b0
    c = c0
    d = d0
right = max(c, d)
left = min(a, b)
middle = max(a, b)
for i in range(n - 1):
    if s[i] == "#" and s[i + 1] == "#":  # 岩が2個連続である場合
        if i <= right - 2 and i >= left - 1:
            print("No")
            break
else:
    if c < d:
        print("Yes")
    else:
        for i in range(n - 2):
            if s[i] == "." and s[i + 1] == "." and s[i + 2] == ".":  # 入れ替え可能
                if i + 1 == b - 1:
                    print("Yes")
                    break
                if i <= d - 2 and i >= b - 1:
                    print("Yes")
                    break
        else:
            print("No")

N, A, B, C, D = list(map(int, input().split()))
S = "$" + eval(input()) + "$"


def isOk(fr, to):
    if S[fr : to + 1].count("##") > 0:
        return False
    return True


if not (isOk(A, C) and isOk(C, D)):
    print("No")
    exit()


def canSwitch():
    if A + 1 == B and D < C and S[A : A + 3] == "...":
        return True
    if B + 1 == A and C < D and S[B : B + 3] == "...":
        return True
    if C + 1 == D and B < A and S[C - 1 : D + 1] == "...":
        return True
    if D + 1 == C and A < B and S[D - 1 : C + 1] == "...":
        return True
    if A < B and S[B - 1 : B + 2] == "...":
        return True
    if B < A and S[A - 1 : A + 2] == "...":
        return True
    if C < D and S[C - 1 : C + 2] == "...":
        return True
    if D < C and S[D - 1 : D + 2] == "...":
        return True
    if S[max(A, B) : min(C, D) + 1].count("..."):
        return True
    return False


if A < B and D < C or B < A and C < D:
    if not canSwitch():
        print("No")
        exit()
print("Yes")

-n, a0, b0, c0, d0 = list(map(int, input().split())) -s = eval(input()) -# a < b に変換する -if a0 > b0:  # 入れ替える -    a = b0 -    b = a0 -    c = d0 -    d = c0 -else:  # 入れ替えない -    a = a0 -    b = b0 -    c = c0 -    d = d0 -right = max(c, d) -left = min(a, b) -middle = max(a, b) -for i in range(n - 1): -    if s[i] == "#" and s[i + 1] == "#":  # 岩が2個連続である場合 -        if i <= right - 2 and i >= left - 1: -            print("No") -            break -else: -    if c < d: -        print("Yes") -    else: -        for i in range(n - 2): -            if s[i] == "." and s[i + 1] == "." and s[i + 2] == ".":  # 入れ替え可能 -                if i + 1 == b - 1: -                    print("Yes") -                    break -                if i <= d - 2 and i >= b - 1: -                    print("Yes") -                    break -        else: -            print("No") +N, A, B, C, D = list(map(int, input().split())) +S = "$" + eval(input()) + "$" + + +def isOk(fr, to): +    if S[fr : to + 1].count("##") > 0: +        return False +    return True + + +if not (isOk(A, C) and isOk(C, D)): +    print("No") +    exit() + + +def canSwitch(): +    if A + 1 == B and D < C and S[A : A + 3] == "...": +        return True +    if B + 1 == A and C < D and S[B : B + 3] == "...": +        return True +    if C + 1 == D and B < A and S[C - 1 : D + 1] == "...": +        return True +    if D + 1 == C and A < B and S[D - 1 : C + 1] == "...": +        return True +    if A < B and S[B - 1 : B + 2] == "...": +        return True +    if B < A and S[A - 1 : A + 2] == "...": +        return True +    if C < D and S[C - 1 : C + 2] == "...": +        return True +    if D < C and S[D - 1 : D + 2] == "...": +        return True +    if S[max(A, B) : min(C, D) + 1].count("..."): +        return True +    return False + + +if A < B and D < C or B < A and C < D: +    if not canSwitch(): +        print("No") +        exit() +print("Yes")