def main():
    n, a, b, c, d = map(int,input().split())
    s = list(input())
    if c<d:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        print('Yes')
    else:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return

        for i in range(b-1,d):
            if s[i-1] == s[i] == s[i+1] and s[i] == '.':
                print('Yes')
                return


        print('No')



if __name__ == '__main__':
    main() def main():
    n, a, b, c, d = map(int,input().split())
    s = list(input())
    if c<d:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        print('Yes')
    else:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return

        for i in range(b-1,d):
            if s[i-1] == s[i] == s[i+1] and s[i] == '.':
                print('Yes')
                return


        print('No') 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 s = list(input()) s list(input()) list input() input if c<d:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        print('Yes')
    else:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return

        for i in range(b-1,d):
            if s[i-1] == s[i] == s[i+1] and s[i] == '.':
                print('Yes')
                return


        print('No') c<d c d for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
         i range(a-1,c-2) range a-1 a 1 c-2 c 2 if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
         s[i] == s[i+1] and s[i] == '#' s[i] == s[i+1] s[i] s i s[i+1] s i+1 i 1 s[i] == '#' s[i] s i '#' print('No') print 'No' return for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
         i range(b-1,d-2) range b-1 b 1 d-2 d 2 if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
         s[i] == s[i+1] and s[i] == '#' s[i] == s[i+1] s[i] s i s[i+1] s i+1 i 1 s[i] == '#' s[i] s i '#' print('No') print 'No' return print('Yes') print 'Yes' for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
         i range(a-1,c-2) range a-1 a 1 c-2 c 2 if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
         s[i] == s[i+1] and s[i] == '#' s[i] == s[i+1] s[i] s i s[i+1] s i+1 i 1 s[i] == '#' s[i] s i '#' print('No') print 'No' return for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return

         i range(b-1,d-2) range b-1 b 1 d-2 d 2 if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return

         s[i] == s[i+1] and s[i] == '#' s[i] == s[i+1] s[i] s i s[i+1] s i+1 i 1 s[i] == '#' s[i] s i '#' print('No') print 'No' return for i in range(b-1,d):
            if s[i-1] == s[i] == s[i+1] and s[i] == '.':
                print('Yes')
                return


         i range(b-1,d) range b-1 b 1 d if s[i-1] == s[i] == s[i+1] and s[i] == '.':
                print('Yes')
                return


         s[i-1] == s[i] == s[i+1] and s[i] == '.' 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 s[i] == '.' s[i] s i '.' print('Yes') print 'Yes' return print('No') print 'No' if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n, a, b, c, d = map(int,input().split())
    s = list(input())
    if c<d:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        print('Yes')
    else:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return

        for i in range(b-1,d):
            if s[i-1] == s[i] == s[i+1] and s[i] == '.':
                print('Yes')
                return


        print('No') def main():
    n, a, b, c, d = map(int,input().split())
    s = list(input())
    if c<d:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        print('Yes')
    else:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return

        for i in range(b-1,d):
            if s[i-1] == s[i] == s[i+1] and s[i] == '.':
                print('Yes')
                return


        print('No') main
def main():
    n, a, b, c, d = map(int,input().split())
    s = list(input())
    if c<d:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        print('Yes')
    else:
        for i in range(a-1,c-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return
        for i in range(b-1,d-2):
            if s[i] == s[i+1] and s[i] == '#':
                print('No')
                return

        for i in range(b-1,d):
            if s[i-1] == s[i] == s[i+1] and s[i] == '.':
                print('Yes')
                return


        print('No')



if __name__ == '__main__':
    main()
