def resolve():
    N, A, B, C, D = map(int, input().split())
    S = str(input())
    if C < D:
        if '##' in S[min(A, B):D]:
            print('No')
        else:
            print('Yes')
    elif C > D:
        if '##' in S[min(A, B):C]:
            print('No')
        else:
            if '...' in S[B-2:D+1]:
                print('Yes')
            else:
                print('No')


resolve() def resolve():
    N, A, B, C, D = map(int, input().split())
    S = str(input())
    if C < D:
        if '##' in S[min(A, B):D]:
            print('No')
        else:
            print('Yes')
    elif C > D:
        if '##' in S[min(A, B):C]:
            print('No')
        else:
            if '...' in S[B-2:D+1]:
                print('Yes')
            else:
                print('No') resolve 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 = str(input()) S str(input()) str input() input if C < D:
        if '##' in S[min(A, B):D]:
            print('No')
        else:
            print('Yes')
    elif C > D:
        if '##' in S[min(A, B):C]:
            print('No')
        else:
            if '...' in S[B-2:D+1]:
                print('Yes')
            else:
                print('No') C < D C D if '##' in S[min(A, B):D]:
            print('No')
        else:
            print('Yes')
     '##' in S[min(A, B):D] '##' S[min(A, B):D] S min(A, B):D min(A, B) min A B D print('No') print 'No' print('Yes') print 'Yes' elif C > D:
        if '##' in S[min(A, B):C]:
            print('No')
        else:
            if '...' in S[B-2:D+1]:
                print('Yes')
            else:
                print('No') C > D C D if '##' in S[min(A, B):C]:
            print('No')
        else:
            if '...' in S[B-2:D+1]:
                print('Yes')
            else:
                print('No') '##' in S[min(A, B):C] '##' S[min(A, B):C] S min(A, B):C min(A, B) min A B C print('No') print 'No' if '...' in S[B-2:D+1]:
                print('Yes')
            else:
                print('No') '...' in S[B-2:D+1] '...' S[B-2:D+1] S B-2:D+1 B-2 B 2 D+1 D 1 print('Yes') print 'Yes' print('No') print 'No' resolve() resolve def resolve():
    N, A, B, C, D = map(int, input().split())
    S = str(input())
    if C < D:
        if '##' in S[min(A, B):D]:
            print('No')
        else:
            print('Yes')
    elif C > D:
        if '##' in S[min(A, B):C]:
            print('No')
        else:
            if '...' in S[B-2:D+1]:
                print('Yes')
            else:
                print('No') def resolve():
    N, A, B, C, D = map(int, input().split())
    S = str(input())
    if C < D:
        if '##' in S[min(A, B):D]:
            print('No')
        else:
            print('Yes')
    elif C > D:
        if '##' in S[min(A, B):C]:
            print('No')
        else:
            if '...' in S[B-2:D+1]:
                print('Yes')
            else:
                print('No') resolve
def resolve():
    N, A, B, C, D = map(int, input().split())
    S = str(input())
    if C < D:
        if '##' in S[min(A, B):D]:
            print('No')
        else:
            print('Yes')
    elif C > D:
        if '##' in S[min(A, B):C]:
            print('No')
        else:
            if '...' in S[B-2:D+1]:
                print('Yes')
            else:
                print('No')


resolve()