# Problem A - Kenken Race



# input

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

S = list(eval(input()))



# check

if C<D:

    # B check

    is_ok = True

    for i in range(B, D-1):

        if S[i]=='#' and S[i+1]=='#':

            is_ok = False

            break

    # A check

    for i in range(A, C-1):

        if S[i]=='#' and S[i+1]=='#':

            is_ok = False

            break

    # output

    if is_ok:

        print("Yes")

    else:

        print("No")

else:

    is_ok = False

    # B check

    for i in range(B, D):

        if S[i]=='#' and S[i+1]=='#':

            is_ok = False

            break

    for i in range(B-1, D):

        if S[i-1]=='.' and S[i]=='.' and S[i+1]=='.':

            is_ok = True

    # A check

    for i in range(A, C-1):

        if S[i]=='#' and S[i+1]=='#':

            is_ok = False

            break

    # output

    if is_ok:

        print("Yes")

    else:

        print("No")

# Problem A - Kenken Race



# input

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

S = eval(input())



# initialization

is_ok = True



# search

if C>D:

    # b check

    if "##" in S[B-1:D] or not "..." in S[B-2:D+1]:

        is_ok = False



    # a check

    if "##" in S[A-1:C]:

        is_ok = False

else:

    # b check

    if "##" in S[B-1:D]:

        is_ok = False



    # a check

    if "##" in S[A-1:C]:

        is_ok = False



# output

if is_ok:

    print("Yes")

else:

    print("No")

# Problem A - Kenken Race
# input
N, A, B, C, D = list(map(int, input().split()))
S = list(eval(input()))
# check
if C < D:
    # B check
    is_ok = True
    for i in range(B, D - 1):
        if S[i] == "#" and S[i + 1] == "#":
            is_ok = False
            break
    # A check
    for i in range(A, C - 1):
        if S[i] == "#" and S[i + 1] == "#":
            is_ok = False
            break
    # output
    if is_ok:
        print("Yes")
    else:
        print("No")
else:
    is_ok = False
    # B check
    for i in range(B, D):
        if S[i] == "#" and S[i + 1] == "#":
            is_ok = False
            break
    for i in range(B - 1, D):
        if S[i - 1] == "." and S[i] == "." and S[i + 1] == ".":
            is_ok = True
    # A check
    for i in range(A, C - 1):
        if S[i] == "#" and S[i + 1] == "#":
            is_ok = False
            break
    # output
    if is_ok:
        print("Yes")
    else:
        print("No")

# Problem A - Kenken Race
# input
N, A, B, C, D = list(map(int, input().split()))
S = eval(input())
# initialization
is_ok = True
# search
if C > D:
    # b check
    if "##" in S[B - 1 : D] or not "..." in S[B - 2 : D + 1]:
        is_ok = False
    # a check
    if "##" in S[A - 1 : C]:
        is_ok = False
else:
    # b check
    if "##" in S[B - 1 : D]:
        is_ok = False
    # a check
    if "##" in S[A - 1 : C]:
        is_ok = False
# output
if is_ok:
    print("Yes")
else:
    print("No")

-S = list(eval(input())) -# check -if C < D: -    # B check -    is_ok = True -    for i in range(B, D - 1): -        if S[i] == "#" and S[i + 1] == "#": -            is_ok = False -            break -    # A check -    for i in range(A, C - 1): -        if S[i] == "#" and S[i + 1] == "#": -            is_ok = False -            break -    # output -    if is_ok: -        print("Yes") -    else: -        print("No") +S = eval(input()) +# initialization +is_ok = True +# search +if C > D: +    # b check +    if "##" in S[B - 1 : D] or not "..." in S[B - 2 : D + 1]: +        is_ok = False +    # a check +    if "##" in S[A - 1 : C]: +        is_ok = False -    is_ok = False -    # B check -    for i in range(B, D): -        if S[i] == "#" and S[i + 1] == "#": -            is_ok = False -            break -    for i in range(B - 1, D): -        if S[i - 1] == "." and S[i] == "." and S[i + 1] == ".": -            is_ok = True -    # A check -    for i in range(A, C - 1): -        if S[i] == "#" and S[i + 1] == "#": -            is_ok = False -            break -    # output -    if is_ok: -        print("Yes") -    else: -        print("No") +    # b check +    if "##" in S[B - 1 : D]: +        is_ok = False +    # a check +    if "##" in S[A - 1 : C]: +        is_ok = False +# output +if is_ok: +    print("Yes") +else: +    print("No")