import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N, A, B, C, D = [int(x) for x in input().split()]
    S = input().strip()

    def rock_check(start, end):
        for a, b in zip(S[start:end], S[start + 1:end]):
            if a == b == "#":
                return False
        else:
            return True

    def three_space_check(start, end):
        start -= 2
        end += 1
        for a, b, c in zip(S[start:end], S[start + 1:end], S[start + 2:end]):
            if a == b == c == ".":
                return True
        else:
            return False

    bfirst = False
    if C < D:
        bfirst = True

    if bfirst:
        if A > B:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(A, C):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No")
    else:
        if B > A:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(B, D):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No")


if __name__ == '__main__':
    main() import sys sys sys.setrecursionlimit(10 ** 8) sys.setrecursionlimit sys setrecursionlimit 10 ** 8 10 8 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline def main():
    N, A, B, C, D = [int(x) for x in input().split()]
    S = input().strip()

    def rock_check(start, end):
        for a, b in zip(S[start:end], S[start + 1:end]):
            if a == b == "#":
                return False
        else:
            return True

    def three_space_check(start, end):
        start -= 2
        end += 1
        for a, b, c in zip(S[start:end], S[start + 1:end], S[start + 2:end]):
            if a == b == c == ".":
                return True
        else:
            return False

    bfirst = False
    if C < D:
        bfirst = True

    if bfirst:
        if A > B:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(A, C):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No")
    else:
        if B > A:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(B, D):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No") main int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x N, A, B, C, D = [int(x) for x in input().split()] N [int(x) for x in input().split()] A B C D S = input().strip() S input().strip() ().strip () input strip def rock_check(start, end):
        for a, b in zip(S[start:end], S[start + 1:end]):
            if a == b == "#":
                return False
        else:
            return True

     rock_check for a, b in zip(S[start:end], S[start + 1:end]):
            if a == b == "#":
                return False
        else:
            return True

     a b zip(S[start:end], S[start + 1:end]) zip S[start:end] S start:end start end S[start + 1:end] S start + 1:end start + 1 start 1 end if a == b == "#":
                return False
         a == b == "#" a == b a b "#" return False False return True True start start end end def three_space_check(start, end):
        start -= 2
        end += 1
        for a, b, c in zip(S[start:end], S[start + 1:end], S[start + 2:end]):
            if a == b == c == ".":
                return True
        else:
            return False

     three_space_check start -= 2 start 2 end += 1 end 1 for a, b, c in zip(S[start:end], S[start + 1:end], S[start + 2:end]):
            if a == b == c == ".":
                return True
        else:
            return False

     a b c zip(S[start:end], S[start + 1:end], S[start + 2:end]) zip S[start:end] S start:end start end S[start + 1:end] S start + 1:end start + 1 start 1 end S[start + 2:end] S start + 2:end start + 2 start 2 end if a == b == c == ".":
                return True
         a == b == c == "." a == b == c a == b a b c "." return True True return False False start start end end bfirst = False bfirst False if C < D:
        bfirst = True

     C < D C D bfirst = True bfirst True if bfirst:
        if A > B:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(A, C):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No")
    else:
        if B > A:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(B, D):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No") bfirst if A > B:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(A, C):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No")
     A > B A B if rock_check(B, D) and rock_check(A, C) and three_space_check(A, C):
                print("Yes")
            else:
                print("No")
         rock_check(B, D) and rock_check(A, C) and three_space_check(A, C) rock_check(B, D) and rock_check(A, C) rock_check(B, D) rock_check B D rock_check(A, C) rock_check A C three_space_check(A, C) three_space_check A C print("Yes") print "Yes" print("No") print "No" if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No")
     rock_check(B, D) and rock_check(A, C) rock_check(B, D) rock_check B D rock_check(A, C) rock_check A C print("Yes") print "Yes" print("No") print "No" if B > A:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(B, D):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No") B > A B A if rock_check(B, D) and rock_check(A, C) and three_space_check(B, D):
                print("Yes")
            else:
                print("No")
         rock_check(B, D) and rock_check(A, C) and three_space_check(B, D) rock_check(B, D) and rock_check(A, C) rock_check(B, D) rock_check B D rock_check(A, C) rock_check A C three_space_check(B, D) three_space_check B D print("Yes") print "Yes" print("No") print "No" if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No") rock_check(B, D) and rock_check(A, C) rock_check(B, D) rock_check B D rock_check(A, C) rock_check A C print("Yes") print "Yes" print("No") print "No" if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main input = sys.stdin.readline sys.stdin.readline input def main():
    N, A, B, C, D = [int(x) for x in input().split()]
    S = input().strip()

    def rock_check(start, end):
        for a, b in zip(S[start:end], S[start + 1:end]):
            if a == b == "#":
                return False
        else:
            return True

    def three_space_check(start, end):
        start -= 2
        end += 1
        for a, b, c in zip(S[start:end], S[start + 1:end], S[start + 2:end]):
            if a == b == c == ".":
                return True
        else:
            return False

    bfirst = False
    if C < D:
        bfirst = True

    if bfirst:
        if A > B:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(A, C):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No")
    else:
        if B > A:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(B, D):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No") def main():
    N, A, B, C, D = [int(x) for x in input().split()]
    S = input().strip()

    def rock_check(start, end):
        for a, b in zip(S[start:end], S[start + 1:end]):
            if a == b == "#":
                return False
        else:
            return True

    def three_space_check(start, end):
        start -= 2
        end += 1
        for a, b, c in zip(S[start:end], S[start + 1:end], S[start + 2:end]):
            if a == b == c == ".":
                return True
        else:
            return False

    bfirst = False
    if C < D:
        bfirst = True

    if bfirst:
        if A > B:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(A, C):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No")
    else:
        if B > A:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(B, D):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No") main
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N, A, B, C, D = [int(x) for x in input().split()]
    S = input().strip()

    def rock_check(start, end):
        for a, b in zip(S[start:end], S[start + 1:end]):
            if a == b == "#":
                return False
        else:
            return True

    def three_space_check(start, end):
        start -= 2
        end += 1
        for a, b, c in zip(S[start:end], S[start + 1:end], S[start + 2:end]):
            if a == b == c == ".":
                return True
        else:
            return False

    bfirst = False
    if C < D:
        bfirst = True

    if bfirst:
        if A > B:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(A, C):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No")
    else:
        if B > A:
            if rock_check(B, D) and rock_check(A, C) and three_space_check(B, D):
                print("Yes")
            else:
                print("No")
        else:
            if rock_check(B, D) and rock_check(A, C):
                print("Yes")
            else:
                print("No")


if __name__ == '__main__':
    main()
