def main():
    import sys
    input = sys.stdin.readline
    N, A, B, C, D = [int(x) for x in input().strip().split()]
    A, B, C, D = A-1, B-1, C-1, D-1
    S = input().strip()
    if C == D:
        print('No')
        return
    if C > D:
        C, D = D, C
        A, B = B, A
    while B != D:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if B + 2 < N and B + 2 != A and S[B+2] == '.':
            B += 2
        elif B + 1!= A and S[B+1] == '.':
            B += 1
        else:
            if A > B:
                if A + 1 < N and B != A + 1 and S[A+1] == '.':
                    A += 1
                elif A + 2 < N and B != A + 2 and S[A+2] == '.':
                    A += 2
                else:
                    print('No')
                    return
            else:
                print('No')
                return
    
        
    while A != C:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if A + 2 < N and B != A + 2 and S[A+2] == '.':
            A += 2
        elif A + 1 < N and B != A + 1 and S[A+1] == '.':
            A += 1
        else:
            print('No')
            return

    # print(S)
    # print(' ' * A + 'A')
    # print(' ' * B + 'B')
    print('Yes')



if __name__ == '__main__':
    main() def main():
    import sys
    input = sys.stdin.readline
    N, A, B, C, D = [int(x) for x in input().strip().split()]
    A, B, C, D = A-1, B-1, C-1, D-1
    S = input().strip()
    if C == D:
        print('No')
        return
    if C > D:
        C, D = D, C
        A, B = B, A
    while B != D:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if B + 2 < N and B + 2 != A and S[B+2] == '.':
            B += 2
        elif B + 1!= A and S[B+1] == '.':
            B += 1
        else:
            if A > B:
                if A + 1 < N and B != A + 1 and S[A+1] == '.':
                    A += 1
                elif A + 2 < N and B != A + 2 and S[A+2] == '.':
                    A += 2
                else:
                    print('No')
                    return
            else:
                print('No')
                return
    
        
    while A != C:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if A + 2 < N and B != A + 2 and S[A+2] == '.':
            A += 2
        elif A + 1 < N and B != A + 1 and S[A+1] == '.':
            A += 1
        else:
            print('No')
            return

    # print(S)
    # print(' ' * A + 'A')
    # print(' ' * B + 'B')
    print('Yes') main import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline int(x) for x in input().strip().split() for x in input().strip().split() x input().strip().split() ().strip().split ().strip() ().strip () input strip split for x in input().strip().split() int(x) int x N, A, B, C, D = [int(x) for x in input().strip().split()] N [int(x) for x in input().strip().split()] A B C D A, B, C, D = A-1, B-1, C-1, D-1 A A-1 A 1 B B-1 B 1 C C-1 C 1 D D-1 D 1 S = input().strip() S input().strip() ().strip () input strip if C == D:
        print('No')
        return
     C == D C D print('No') print 'No' return if C > D:
        C, D = D, C
        A, B = B, A
     C > D C D C, D = D, C C D D C A, B = B, A A B B A while B != D:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if B + 2 < N and B + 2 != A and S[B+2] == '.':
            B += 2
        elif B + 1!= A and S[B+1] == '.':
            B += 1
        else:
            if A > B:
                if A + 1 < N and B != A + 1 and S[A+1] == '.':
                    A += 1
                elif A + 2 < N and B != A + 2 and S[A+2] == '.':
                    A += 2
                else:
                    print('No')
                    return
            else:
                print('No')
                return
    
        
     B != D B D if B + 2 < N and B + 2 != A and S[B+2] == '.':
            B += 2
        elif B + 1!= A and S[B+1] == '.':
            B += 1
        else:
            if A > B:
                if A + 1 < N and B != A + 1 and S[A+1] == '.':
                    A += 1
                elif A + 2 < N and B != A + 2 and S[A+2] == '.':
                    A += 2
                else:
                    print('No')
                    return
            else:
                print('No')
                return
    
        
     B + 2 < N and B + 2 != A and S[B+2] == '.' B + 2 < N and B + 2 != A B + 2 < N B + 2 B 2 N B + 2 != A B + 2 B 2 A S[B+2] == '.' S[B+2] S B+2 B 2 '.' B += 2 B 2 elif B + 1!= A and S[B+1] == '.':
            B += 1
         B + 1!= A and S[B+1] == '.' B + 1!= A B + 1 B 1 A S[B+1] == '.' S[B+1] S B+1 B 1 '.' B += 1 B 1 if A > B:
                if A + 1 < N and B != A + 1 and S[A+1] == '.':
                    A += 1
                elif A + 2 < N and B != A + 2 and S[A+2] == '.':
                    A += 2
                else:
                    print('No')
                    return
            else:
                print('No')
                return
    
        
     A > B A B if A + 1 < N and B != A + 1 and S[A+1] == '.':
                    A += 1
                elif A + 2 < N and B != A + 2 and S[A+2] == '.':
                    A += 2
                else:
                    print('No')
                    return
             A + 1 < N and B != A + 1 and S[A+1] == '.' A + 1 < N and B != A + 1 A + 1 < N A + 1 A 1 N B != A + 1 B A + 1 A 1 S[A+1] == '.' S[A+1] S A+1 A 1 '.' A += 1 A 1 elif A + 2 < N and B != A + 2 and S[A+2] == '.':
                    A += 2
                 A + 2 < N and B != A + 2 and S[A+2] == '.' A + 2 < N and B != A + 2 A + 2 < N A + 2 A 2 N B != A + 2 B A + 2 A 2 S[A+2] == '.' S[A+2] S A+2 A 2 '.' A += 2 A 2 print('No') print 'No' return print('No') print 'No' return while A != C:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if A + 2 < N and B != A + 2 and S[A+2] == '.':
            A += 2
        elif A + 1 < N and B != A + 1 and S[A+1] == '.':
            A += 1
        else:
            print('No')
            return

    # print(S)
    # print(' ' * A + 'A')
    # print(' ' * B + 'B')
     A != C A C if A + 2 < N and B != A + 2 and S[A+2] == '.':
            A += 2
        elif A + 1 < N and B != A + 1 and S[A+1] == '.':
            A += 1
        else:
            print('No')
            return

    # print(S)
    # print(' ' * A + 'A')
    # print(' ' * B + 'B')
     A + 2 < N and B != A + 2 and S[A+2] == '.' A + 2 < N and B != A + 2 A + 2 < N A + 2 A 2 N B != A + 2 B A + 2 A 2 S[A+2] == '.' S[A+2] S A+2 A 2 '.' A += 2 A 2 elif A + 1 < N and B != A + 1 and S[A+1] == '.':
            A += 1
         A + 1 < N and B != A + 1 and S[A+1] == '.' A + 1 < N and B != A + 1 A + 1 < N A + 1 A 1 N B != A + 1 B A + 1 A 1 S[A+1] == '.' S[A+1] S A+1 A 1 '.' A += 1 A 1 print('No') print 'No' return print('Yes') print 'Yes' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    import sys
    input = sys.stdin.readline
    N, A, B, C, D = [int(x) for x in input().strip().split()]
    A, B, C, D = A-1, B-1, C-1, D-1
    S = input().strip()
    if C == D:
        print('No')
        return
    if C > D:
        C, D = D, C
        A, B = B, A
    while B != D:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if B + 2 < N and B + 2 != A and S[B+2] == '.':
            B += 2
        elif B + 1!= A and S[B+1] == '.':
            B += 1
        else:
            if A > B:
                if A + 1 < N and B != A + 1 and S[A+1] == '.':
                    A += 1
                elif A + 2 < N and B != A + 2 and S[A+2] == '.':
                    A += 2
                else:
                    print('No')
                    return
            else:
                print('No')
                return
    
        
    while A != C:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if A + 2 < N and B != A + 2 and S[A+2] == '.':
            A += 2
        elif A + 1 < N and B != A + 1 and S[A+1] == '.':
            A += 1
        else:
            print('No')
            return

    # print(S)
    # print(' ' * A + 'A')
    # print(' ' * B + 'B')
    print('Yes') def main():
    import sys
    input = sys.stdin.readline
    N, A, B, C, D = [int(x) for x in input().strip().split()]
    A, B, C, D = A-1, B-1, C-1, D-1
    S = input().strip()
    if C == D:
        print('No')
        return
    if C > D:
        C, D = D, C
        A, B = B, A
    while B != D:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if B + 2 < N and B + 2 != A and S[B+2] == '.':
            B += 2
        elif B + 1!= A and S[B+1] == '.':
            B += 1
        else:
            if A > B:
                if A + 1 < N and B != A + 1 and S[A+1] == '.':
                    A += 1
                elif A + 2 < N and B != A + 2 and S[A+2] == '.':
                    A += 2
                else:
                    print('No')
                    return
            else:
                print('No')
                return
    
        
    while A != C:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if A + 2 < N and B != A + 2 and S[A+2] == '.':
            A += 2
        elif A + 1 < N and B != A + 1 and S[A+1] == '.':
            A += 1
        else:
            print('No')
            return

    # print(S)
    # print(' ' * A + 'A')
    # print(' ' * B + 'B')
    print('Yes') main
def main():
    import sys
    input = sys.stdin.readline
    N, A, B, C, D = [int(x) for x in input().strip().split()]
    A, B, C, D = A-1, B-1, C-1, D-1
    S = input().strip()
    if C == D:
        print('No')
        return
    if C > D:
        C, D = D, C
        A, B = B, A
    while B != D:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if B + 2 < N and B + 2 != A and S[B+2] == '.':
            B += 2
        elif B + 1!= A and S[B+1] == '.':
            B += 1
        else:
            if A > B:
                if A + 1 < N and B != A + 1 and S[A+1] == '.':
                    A += 1
                elif A + 2 < N and B != A + 2 and S[A+2] == '.':
                    A += 2
                else:
                    print('No')
                    return
            else:
                print('No')
                return
    
        
    while A != C:
        # print(S)
        # print(' ' * A + 'A')
        # print(' ' * B + 'B')
        if A + 2 < N and B != A + 2 and S[A+2] == '.':
            A += 2
        elif A + 1 < N and B != A + 1 and S[A+1] == '.':
            A += 1
        else:
            print('No')
            return

    # print(S)
    # print(' ' * A + 'A')
    # print(' ' * B + 'B')
    print('Yes')



if __name__ == '__main__':
    main()