import sys
input = sys.stdin.readline  # NOQA


def main():
    N, A, B, C, D = map(int, input().split())
    A -= 1
    B -= 1
    C -= 1
    D -= 1
    S = input().rstrip()

    can_jump_R = True  # '##'
    can_jump_B = False  # '...'
    for i in range(A + 1, N - 1):
        if S[i] == S[i+1] == "#":
            if A < i < C or B < i < D:
                can_jump_R = False
        if S[i-1] == S[i] == S[i+1] == ".":
            if B <= i < C and i-1 != D:
                can_jump_B = True

    if C < D:
        if can_jump_R:
            ans = "Yes"
        else:
            ans = "No"
    else:
        if can_jump_R and can_jump_B:
            ans = "Yes"
        else:
            ans = "No"
    print(ans)


if __name__ == "__main__":
    main() import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def main():
    N, A, B, C, D = map(int, input().split())
    A -= 1
    B -= 1
    C -= 1
    D -= 1
    S = input().rstrip()

    can_jump_R = True  # '##'
    can_jump_B = False  # '...'
    for i in range(A + 1, N - 1):
        if S[i] == S[i+1] == "#":
            if A < i < C or B < i < D:
                can_jump_R = False
        if S[i-1] == S[i] == S[i+1] == ".":
            if B <= i < C and i-1 != D:
                can_jump_B = True

    if C < D:
        if can_jump_R:
            ans = "Yes"
        else:
            ans = "No"
    else:
        if can_jump_R and can_jump_B:
            ans = "Yes"
        else:
            ans = "No"
    print(ans) main N, A, B, C, D = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split A B C D A -= 1 A 1 B -= 1 B 1 C -= 1 C 1 D -= 1 D 1 S = input().rstrip() S input().rstrip() ().rstrip () input rstrip can_jump_R = True can_jump_R True can_jump_B = False can_jump_B False for i in range(A + 1, N - 1):
        if S[i] == S[i+1] == "#":
            if A < i < C or B < i < D:
                can_jump_R = False
        if S[i-1] == S[i] == S[i+1] == ".":
            if B <= i < C and i-1 != D:
                can_jump_B = True

     i range(A + 1, N - 1) range A + 1 A 1 N - 1 N 1 if S[i] == S[i+1] == "#":
            if A < i < C or B < i < D:
                can_jump_R = False
         S[i] == S[i+1] == "#" S[i] == S[i+1] S[i] S i S[i+1] S i+1 i 1 "#" if A < i < C or B < i < D:
                can_jump_R = False
         A < i < C or B < i < D A < i < C A < i A i C B < i < D B < i B i D can_jump_R = False can_jump_R False if S[i-1] == S[i] == S[i+1] == ".":
            if B <= i < C and i-1 != D:
                can_jump_B = True

     S[i-1] == S[i] == S[i+1] == "." S[i-1] == S[i] == S[i+1] S[i-1] == S[i] S[i-1] S i-1 i 1 S[i] S i S[i+1] S i+1 i 1 "." if B <= i < C and i-1 != D:
                can_jump_B = True

     B <= i < C and i-1 != D B <= i < C B <= i B i C i-1 != D i-1 i 1 D can_jump_B = True can_jump_B True if C < D:
        if can_jump_R:
            ans = "Yes"
        else:
            ans = "No"
    else:
        if can_jump_R and can_jump_B:
            ans = "Yes"
        else:
            ans = "No"
     C < D C D if can_jump_R:
            ans = "Yes"
        else:
            ans = "No"
     can_jump_R ans = "Yes" ans "Yes" ans = "No" ans "No" if can_jump_R and can_jump_B:
            ans = "Yes"
        else:
            ans = "No"
     can_jump_R and can_jump_B can_jump_R can_jump_B ans = "Yes" ans "Yes" ans = "No" ans "No" print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N, A, B, C, D = map(int, input().split())
    A -= 1
    B -= 1
    C -= 1
    D -= 1
    S = input().rstrip()

    can_jump_R = True  # '##'
    can_jump_B = False  # '...'
    for i in range(A + 1, N - 1):
        if S[i] == S[i+1] == "#":
            if A < i < C or B < i < D:
                can_jump_R = False
        if S[i-1] == S[i] == S[i+1] == ".":
            if B <= i < C and i-1 != D:
                can_jump_B = True

    if C < D:
        if can_jump_R:
            ans = "Yes"
        else:
            ans = "No"
    else:
        if can_jump_R and can_jump_B:
            ans = "Yes"
        else:
            ans = "No"
    print(ans) def main():
    N, A, B, C, D = map(int, input().split())
    A -= 1
    B -= 1
    C -= 1
    D -= 1
    S = input().rstrip()

    can_jump_R = True  # '##'
    can_jump_B = False  # '...'
    for i in range(A + 1, N - 1):
        if S[i] == S[i+1] == "#":
            if A < i < C or B < i < D:
                can_jump_R = False
        if S[i-1] == S[i] == S[i+1] == ".":
            if B <= i < C and i-1 != D:
                can_jump_B = True

    if C < D:
        if can_jump_R:
            ans = "Yes"
        else:
            ans = "No"
    else:
        if can_jump_R and can_jump_B:
            ans = "Yes"
        else:
            ans = "No"
    print(ans) main input = sys.stdin.readline sys.stdin.readline input
import sys
input = sys.stdin.readline  # NOQA


def main():
    N, A, B, C, D = map(int, input().split())
    A -= 1
    B -= 1
    C -= 1
    D -= 1
    S = input().rstrip()

    can_jump_R = True  # '##'
    can_jump_B = False  # '...'
    for i in range(A + 1, N - 1):
        if S[i] == S[i+1] == "#":
            if A < i < C or B < i < D:
                can_jump_R = False
        if S[i-1] == S[i] == S[i+1] == ".":
            if B <= i < C and i-1 != D:
                can_jump_B = True

    if C < D:
        if can_jump_R:
            ans = "Yes"
        else:
            ans = "No"
    else:
        if can_jump_R and can_jump_B:
            ans = "Yes"
        else:
            ans = "No"
    print(ans)


if __name__ == "__main__":
    main()
