def resolve():
    '''
    code here
    '''
    N, A, B, C, D = [int(item) for item in input().split()]
    S = input()


    if C < D:
        is_goal = True
        for i in range(A, D+1):
            if S[i-1:i+1] == '##':
                is_goal = False
                break
    else:
        is_goal = False
        for i in range(A, C+1):
            if S[i-1:i+1] == '##':
                is_goal = False

            if B <= i <= D:
                if S[i-2:i+1] == '...' :
                    is_goal = True

    print('Yes') if is_goal else print('No')

if __name__ == "__main__":
    resolve() def resolve():
    '''
    code here
    '''
    N, A, B, C, D = [int(item) for item in input().split()]
    S = input()


    if C < D:
        is_goal = True
        for i in range(A, D+1):
            if S[i-1:i+1] == '##':
                is_goal = False
                break
    else:
        is_goal = False
        for i in range(A, C+1):
            if S[i-1:i+1] == '##':
                is_goal = False

            if B <= i <= D:
                if S[i-2:i+1] == '...' :
                    is_goal = True

    print('Yes') if is_goal else print('No') resolve '''
    code here
    ''' int(item) for item in input().split() for item in input().split() item input().split() ().split () input split for item in input().split() int(item) int item N, A, B, C, D = [int(item) for item in input().split()] N [int(item) for item in input().split()] A B C D S = input() S input() input if C < D:
        is_goal = True
        for i in range(A, D+1):
            if S[i-1:i+1] == '##':
                is_goal = False
                break
    else:
        is_goal = False
        for i in range(A, C+1):
            if S[i-1:i+1] == '##':
                is_goal = False

            if B <= i <= D:
                if S[i-2:i+1] == '...' :
                    is_goal = True

     C < D C D is_goal = True is_goal True for i in range(A, D+1):
            if S[i-1:i+1] == '##':
                is_goal = False
                break
     i range(A, D+1) range A D+1 D 1 if S[i-1:i+1] == '##':
                is_goal = False
                break
     S[i-1:i+1] == '##' S[i-1:i+1] S i-1:i+1 i-1 i 1 i+1 i 1 '##' is_goal = False is_goal False break is_goal = False is_goal False for i in range(A, C+1):
            if S[i-1:i+1] == '##':
                is_goal = False

            if B <= i <= D:
                if S[i-2:i+1] == '...' :
                    is_goal = True

     i range(A, C+1) range A C+1 C 1 if S[i-1:i+1] == '##':
                is_goal = False

             S[i-1:i+1] == '##' S[i-1:i+1] S i-1:i+1 i-1 i 1 i+1 i 1 '##' is_goal = False is_goal False if B <= i <= D:
                if S[i-2:i+1] == '...' :
                    is_goal = True

     B <= i <= D B <= i B i D if S[i-2:i+1] == '...' :
                    is_goal = True

     S[i-2:i+1] == '...' S[i-2:i+1] S i-2:i+1 i-2 i 2 i+1 i 1 '...' is_goal = True is_goal True print('Yes') if is_goal else print('No') is_goal print('Yes') print 'Yes' print('No') print 'No' if __name__ == "__main__":
    resolve() __name__ == "__main__" __name__ "__main__" resolve() resolve def resolve():
    '''
    code here
    '''
    N, A, B, C, D = [int(item) for item in input().split()]
    S = input()


    if C < D:
        is_goal = True
        for i in range(A, D+1):
            if S[i-1:i+1] == '##':
                is_goal = False
                break
    else:
        is_goal = False
        for i in range(A, C+1):
            if S[i-1:i+1] == '##':
                is_goal = False

            if B <= i <= D:
                if S[i-2:i+1] == '...' :
                    is_goal = True

    print('Yes') if is_goal else print('No') def resolve():
    '''
    code here
    '''
    N, A, B, C, D = [int(item) for item in input().split()]
    S = input()


    if C < D:
        is_goal = True
        for i in range(A, D+1):
            if S[i-1:i+1] == '##':
                is_goal = False
                break
    else:
        is_goal = False
        for i in range(A, C+1):
            if S[i-1:i+1] == '##':
                is_goal = False

            if B <= i <= D:
                if S[i-2:i+1] == '...' :
                    is_goal = True

    print('Yes') if is_goal else print('No') resolve
def resolve():
    '''
    code here
    '''
    N, A, B, C, D = [int(item) for item in input().split()]
    S = input()


    if C < D:
        is_goal = True
        for i in range(A, D+1):
            if S[i-1:i+1] == '##':
                is_goal = False
                break
    else:
        is_goal = False
        for i in range(A, C+1):
            if S[i-1:i+1] == '##':
                is_goal = False

            if B <= i <= D:
                if S[i-2:i+1] == '...' :
                    is_goal = True

    print('Yes') if is_goal else print('No')

if __name__ == "__main__":
    resolve()
