def main():
    n, a, b, c, d = map(int, input().split())
    s = input()
    s = '.' + s

    if '##' in s[a+1:c] or '##' in s[b+1:d]:
        print('No')
    else:
        if c < b:
            print('Yes')
        elif c < d:
            print('Yes')
        else:
            if '...' in s[b-1:d+2]:
                print('Yes')
            else:
                print('No')


if __name__ == '__main__':
    main() def main():
    n, a, b, c, d = map(int, input().split())
    s = input()
    s = '.' + s

    if '##' in s[a+1:c] or '##' in s[b+1:d]:
        print('No')
    else:
        if c < b:
            print('Yes')
        elif c < d:
            print('Yes')
        else:
            if '...' in s[b-1:d+2]:
                print('Yes')
            else:
                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 = input() s input() input s = '.' + s s '.' + s '.' s if '##' in s[a+1:c] or '##' in s[b+1:d]:
        print('No')
    else:
        if c < b:
            print('Yes')
        elif c < d:
            print('Yes')
        else:
            if '...' in s[b-1:d+2]:
                print('Yes')
            else:
                print('No') '##' in s[a+1:c] or '##' in s[b+1:d] '##' in s[a+1:c] '##' s[a+1:c] s a+1:c a+1 a 1 c '##' in s[b+1:d] '##' s[b+1:d] s b+1:d b+1 b 1 d print('No') print 'No' if c < b:
            print('Yes')
        elif c < d:
            print('Yes')
        else:
            if '...' in s[b-1:d+2]:
                print('Yes')
            else:
                print('No') c < b c b print('Yes') print 'Yes' elif c < d:
            print('Yes')
         c < d c d print('Yes') print 'Yes' if '...' in s[b-1:d+2]:
                print('Yes')
            else:
                print('No') '...' in s[b-1:d+2] '...' s[b-1:d+2] s b-1:d+2 b-1 b 1 d+2 d 2 print('Yes') print 'Yes' 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 = input()
    s = '.' + s

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

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

    if '##' in s[a+1:c] or '##' in s[b+1:d]:
        print('No')
    else:
        if c < b:
            print('Yes')
        elif c < d:
            print('Yes')
        else:
            if '...' in s[b-1:d+2]:
                print('Yes')
            else:
                print('No')


if __name__ == '__main__':
    main()
