program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,a,b,c,d
    character(:),allocatable:: s

    read*, n,a,b,c,d
    allocate(character(n):: s)
    read*, s
    
    if (.not.(can_reach_the_goal(a,c) .and. can_reach_the_goal(b,d))) then
        print'(a)', 'No'
        stop
    end if

    if (c < d) then
        print'(a)', 'Yes'
        stop
    end if

    if (exist_jump_point(b,d)) then
        print'(a)', 'Yes'
    else
        print'(a)', 'No'
    end if

contains
recursive function can_reach_the_goal(ori,dest) result(ret)
    integer(int32):: ori, dest
    logical:: ret

    ret = .false.
    if (ori == dest)then
        ret = .true.
        return
    end if

    if (ori+1 <= n) then 
        if (s(ori+1:ori+1) == '.') ret = ret .or. can_reach_the_goal(ori+1,dest)
    end if

    if (ori+2 <= n) then
        if (s(ori+2:ori+2) == '.') ret = ret .or. can_reach_the_goal(ori+2,dest)
    end if    
end function

recursive function exist_jump_point(ori,dest) result(ret)
    integer(int32):: ori, dest
    logical:: ret

    ret = .false.
    if (ori > d) return
    if (s(ori-1:ori-1)=='.' .and. s(ori+1:ori+1)=='.')then
        ret = .true.
        return
    end if

    if (ori+1 <= n) then 
        if (s(ori+1:ori+1) == '.') ret = ret .or. exist_jump_point(ori+1,dest)
    end if

    if (ori+2 <= n) then
        if (s(ori+2:ori+2) == '.') ret = ret .or. exist_jump_point(ori+2,dest)
    end if    
end function

end program name