import sys

input = 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()

    if C < D:
        is_ok = True
        for i in range(A, D):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        ans = "Yes" if is_ok else "No"
    else:
        is_ok = True
        for i in range(A, C):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        if not is_ok:
            ans = "No"
        else:
            is_ok = False
            for i in range(B, D + 1):
                if S[i - 1:i + 2] == "...":
                    is_ok = True
                    break
            ans = "Yes" if is_ok else "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()

    if C < D:
        is_ok = True
        for i in range(A, D):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        ans = "Yes" if is_ok else "No"
    else:
        is_ok = True
        for i in range(A, C):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        if not is_ok:
            ans = "No"
        else:
            is_ok = False
            for i in range(B, D + 1):
                if S[i - 1:i + 2] == "...":
                    is_ok = True
                    break
            ans = "Yes" if is_ok else "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 if C < D:
        is_ok = True
        for i in range(A, D):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        ans = "Yes" if is_ok else "No"
    else:
        is_ok = True
        for i in range(A, C):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        if not is_ok:
            ans = "No"
        else:
            is_ok = False
            for i in range(B, D + 1):
                if S[i - 1:i + 2] == "...":
                    is_ok = True
                    break
            ans = "Yes" if is_ok else "No"

     C < D C D is_ok = True is_ok True for i in range(A, D):
            if S[i:i + 2] == "##":
                is_ok = False
                break
         i range(A, D) range A D if S[i:i + 2] == "##":
                is_ok = False
                break
         S[i:i + 2] == "##" S[i:i + 2] S i:i + 2 i i + 2 i 2 "##" is_ok = False is_ok False break ans = "Yes" if is_ok else "No" ans "Yes" if is_ok else "No" is_ok "Yes" "No" is_ok = True is_ok True for i in range(A, C):
            if S[i:i + 2] == "##":
                is_ok = False
                break
         i range(A, C) range A C if S[i:i + 2] == "##":
                is_ok = False
                break
         S[i:i + 2] == "##" S[i:i + 2] S i:i + 2 i i + 2 i 2 "##" is_ok = False is_ok False break if not is_ok:
            ans = "No"
        else:
            is_ok = False
            for i in range(B, D + 1):
                if S[i - 1:i + 2] == "...":
                    is_ok = True
                    break
            ans = "Yes" if is_ok else "No"

     not is_ok is_ok ans = "No" ans "No" is_ok = False is_ok False for i in range(B, D + 1):
                if S[i - 1:i + 2] == "...":
                    is_ok = True
                    break
             i range(B, D + 1) range B D + 1 D 1 if S[i - 1:i + 2] == "...":
                    is_ok = True
                    break
             S[i - 1:i + 2] == "..." S[i - 1:i + 2] S i - 1:i + 2 i - 1 i 1 i + 2 i 2 "..." is_ok = True is_ok True break ans = "Yes" if is_ok else "No" ans "Yes" if is_ok else "No" is_ok "Yes" "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()

    if C < D:
        is_ok = True
        for i in range(A, D):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        ans = "Yes" if is_ok else "No"
    else:
        is_ok = True
        for i in range(A, C):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        if not is_ok:
            ans = "No"
        else:
            is_ok = False
            for i in range(B, D + 1):
                if S[i - 1:i + 2] == "...":
                    is_ok = True
                    break
            ans = "Yes" if is_ok else "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()

    if C < D:
        is_ok = True
        for i in range(A, D):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        ans = "Yes" if is_ok else "No"
    else:
        is_ok = True
        for i in range(A, C):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        if not is_ok:
            ans = "No"
        else:
            is_ok = False
            for i in range(B, D + 1):
                if S[i - 1:i + 2] == "...":
                    is_ok = True
                    break
            ans = "Yes" if is_ok else "No"

    print(ans) main input = sys.stdin.readline sys.stdin.readline input
import sys

input = 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()

    if C < D:
        is_ok = True
        for i in range(A, D):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        ans = "Yes" if is_ok else "No"
    else:
        is_ok = True
        for i in range(A, C):
            if S[i:i + 2] == "##":
                is_ok = False
                break
        if not is_ok:
            ans = "No"
        else:
            is_ok = False
            for i in range(B, D + 1):
                if S[i - 1:i + 2] == "...":
                    is_ok = True
                    break
            ans = "Yes" if is_ok else "No"

    print(ans)


if __name__ == "__main__":
    main()
