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

S = eval(input())

S = '.' + S

if C < D:

    ans = (

        'Yes' if '##' not in S[A:(D + 1)] else

        'No'

    )

else:

    i = A

    j = B

    while i < C:

        if i + 1 == C or i + 2 == C:

            ans = 'Yes'

            break

        elif i + 1 <= C and S[i + 1] == '.' and i + 1 != j:

            i += 1

        elif i + 2 <= C and S[i + 2] == '.' and i + 2 != j:

            i += 2

        else:

            if j + 1 <= D and S[j + 1] == '.':

                j += 1

            elif j + 2 <= D and S[j + 2] == '.':

                j += 2

            else:

                ans = 'No'

                break



print(ans)

# 入力

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

S = eval(input())



# AからDの間に岩が二つ連続で置かれている箇所があれば不可

# C > D の場合、すぬけ君はふぬけ君を追い越す必要があることに注意

ans = (

    'Yes' if ('##' not in S[(A - 1):max(C, D)]) and (

        C < D or

        '...' in S[(B - 2):(D + 1)]

    ) else

    'No'

)



# 出力

print(ans)

N, A, B, C, D = list(map(int, input().split()))
S = eval(input())
S = "." + S
if C < D:
    ans = "Yes" if "##" not in S[A : (D + 1)] else "No"
else:
    i = A
    j = B
    while i < C:
        if i + 1 == C or i + 2 == C:
            ans = "Yes"
            break
        elif i + 1 <= C and S[i + 1] == "." and i + 1 != j:
            i += 1
        elif i + 2 <= C and S[i + 2] == "." and i + 2 != j:
            i += 2
        else:
            if j + 1 <= D and S[j + 1] == ".":
                j += 1
            elif j + 2 <= D and S[j + 2] == ".":
                j += 2
            else:
                ans = "No"
                break
print(ans)

# 入力
N, A, B, C, D = list(map(int, input().split()))
S = eval(input())
# AからDの間に岩が二つ連続で置かれている箇所があれば不可
# C > D の場合、すぬけ君はふぬけ君を追い越す必要があることに注意
ans = (
    "Yes"
    if ("##" not in S[(A - 1) : max(C, D)]) and (C < D or "..." in S[(B - 2) : (D + 1)])
    else "No"
)
# 出力
print(ans)

+# 入力 -S = "." + S -if C < D: -    ans = "Yes" if "##" not in S[A : (D + 1)] else "No" -else: -    i = A -    j = B -    while i < C: -        if i + 1 == C or i + 2 == C: -            ans = "Yes" -            break -        elif i + 1 <= C and S[i + 1] == "." and i + 1 != j: -            i += 1 -        elif i + 2 <= C and S[i + 2] == "." and i + 2 != j: -            i += 2 -        else: -            if j + 1 <= D and S[j + 1] == ".": -                j += 1 -            elif j + 2 <= D and S[j + 2] == ".": -                j += 2 -            else: -                ans = "No" -                break +# AからDの間に岩が二つ連続で置かれている箇所があれば不可 +# C > D の場合、すぬけ君はふぬけ君を追い越す必要があることに注意 +ans = ( +    "Yes" +    if ("##" not in S[(A - 1) : max(C, D)]) and (C < D or "..." in S[(B - 2) : (D + 1)]) +    else "No" +) +# 出力