def main():
    N, A, B, C, D = list(map(int, input().split(' ')))
    S = input()
    if C == D:
        print('No')
    elif C < D:
        for s in [S[(A-1):C], S[(B-1):D]]:
            for i in range(len(s) - 1):
                if s[i:(i+2)] == '##':
                    print('No')
                    return
        print('Yes')
    else:
        # A B D C
        s = S[(A-1):C]
        for i in range(len(s) - 1):
            if s[i:(i + 2)] == '##':
                print('No')
                return
        s = S[(B-2):(D+1)]
        ok = False
        for i in range(1, len(s) - 1):
            if s[(i-1):(i+2)] == '...':
                ok = True
                break
        print('Yes' if ok else 'No')


if __name__ == '__main__':
    main() def main():
    N, A, B, C, D = list(map(int, input().split(' ')))
    S = input()
    if C == D:
        print('No')
    elif C < D:
        for s in [S[(A-1):C], S[(B-1):D]]:
            for i in range(len(s) - 1):
                if s[i:(i+2)] == '##':
                    print('No')
                    return
        print('Yes')
    else:
        # A B D C
        s = S[(A-1):C]
        for i in range(len(s) - 1):
            if s[i:(i + 2)] == '##':
                print('No')
                return
        s = S[(B-2):(D+1)]
        ok = False
        for i in range(1, len(s) - 1):
            if s[(i-1):(i+2)] == '...':
                ok = True
                break
        print('Yes' if ok else 'No') main N, A, B, C, D = list(map(int, input().split(' '))) N list(map(int, input().split(' '))) list map(int, input().split(' ')) map int input().split(' ') ().split () input split ' ' A B C D S = input() S input() input if C == D:
        print('No')
    elif C < D:
        for s in [S[(A-1):C], S[(B-1):D]]:
            for i in range(len(s) - 1):
                if s[i:(i+2)] == '##':
                    print('No')
                    return
        print('Yes')
    else:
        # A B D C
        s = S[(A-1):C]
        for i in range(len(s) - 1):
            if s[i:(i + 2)] == '##':
                print('No')
                return
        s = S[(B-2):(D+1)]
        ok = False
        for i in range(1, len(s) - 1):
            if s[(i-1):(i+2)] == '...':
                ok = True
                break
        print('Yes' if ok else 'No') C == D C D print('No') print 'No' elif C < D:
        for s in [S[(A-1):C], S[(B-1):D]]:
            for i in range(len(s) - 1):
                if s[i:(i+2)] == '##':
                    print('No')
                    return
        print('Yes')
     C < D C D for s in [S[(A-1):C], S[(B-1):D]]:
            for i in range(len(s) - 1):
                if s[i:(i+2)] == '##':
                    print('No')
                    return
         s [S[(A-1):C], S[(B-1):D]] S[(A-1):C] S (A-1):C A-1 A 1 C S[(B-1):D] S (B-1):D B-1 B 1 D for i in range(len(s) - 1):
                if s[i:(i+2)] == '##':
                    print('No')
                    return
         i range(len(s) - 1) range len(s) - 1 len(s) len s 1 if s[i:(i+2)] == '##':
                    print('No')
                    return
         s[i:(i+2)] == '##' s[i:(i+2)] s i:(i+2) i i+2 i 2 '##' print('No') print 'No' return print('Yes') print 'Yes' s = S[(A-1):C] s S[(A-1):C] S (A-1):C A-1 A 1 C for i in range(len(s) - 1):
            if s[i:(i + 2)] == '##':
                print('No')
                return
         i range(len(s) - 1) range len(s) - 1 len(s) len s 1 if s[i:(i + 2)] == '##':
                print('No')
                return
         s[i:(i + 2)] == '##' s[i:(i + 2)] s i:(i + 2) i i + 2 i 2 '##' print('No') print 'No' return s = S[(B-2):(D+1)] s S[(B-2):(D+1)] S (B-2):(D+1) B-2 B 2 D+1 D 1 ok = False ok False for i in range(1, len(s) - 1):
            if s[(i-1):(i+2)] == '...':
                ok = True
                break
         i range(1, len(s) - 1) range 1 len(s) - 1 len(s) len s 1 if s[(i-1):(i+2)] == '...':
                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 '...' ok = True ok True break print('Yes' if ok else 'No') print 'Yes' if ok else 'No' ok 'Yes' 'No' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N, A, B, C, D = list(map(int, input().split(' ')))
    S = input()
    if C == D:
        print('No')
    elif C < D:
        for s in [S[(A-1):C], S[(B-1):D]]:
            for i in range(len(s) - 1):
                if s[i:(i+2)] == '##':
                    print('No')
                    return
        print('Yes')
    else:
        # A B D C
        s = S[(A-1):C]
        for i in range(len(s) - 1):
            if s[i:(i + 2)] == '##':
                print('No')
                return
        s = S[(B-2):(D+1)]
        ok = False
        for i in range(1, len(s) - 1):
            if s[(i-1):(i+2)] == '...':
                ok = True
                break
        print('Yes' if ok else 'No') def main():
    N, A, B, C, D = list(map(int, input().split(' ')))
    S = input()
    if C == D:
        print('No')
    elif C < D:
        for s in [S[(A-1):C], S[(B-1):D]]:
            for i in range(len(s) - 1):
                if s[i:(i+2)] == '##':
                    print('No')
                    return
        print('Yes')
    else:
        # A B D C
        s = S[(A-1):C]
        for i in range(len(s) - 1):
            if s[i:(i + 2)] == '##':
                print('No')
                return
        s = S[(B-2):(D+1)]
        ok = False
        for i in range(1, len(s) - 1):
            if s[(i-1):(i+2)] == '...':
                ok = True
                break
        print('Yes' if ok else 'No') main
def main():
    N, A, B, C, D = list(map(int, input().split(' ')))
    S = input()
    if C == D:
        print('No')
    elif C < D:
        for s in [S[(A-1):C], S[(B-1):D]]:
            for i in range(len(s) - 1):
                if s[i:(i+2)] == '##':
                    print('No')
                    return
        print('Yes')
    else:
        # A B D C
        s = S[(A-1):C]
        for i in range(len(s) - 1):
            if s[i:(i + 2)] == '##':
                print('No')
                return
        s = S[(B-2):(D+1)]
        ok = False
        for i in range(1, len(s) - 1):
            if s[(i-1):(i+2)] == '...':
                ok = True
                break
        print('Yes' if ok else 'No')


if __name__ == '__main__':
    main()