
def chk():

    n = int(input())

    st = str(input())

    mchr = st[0]
    m = 0

    for i, vi in enumerate(st[1:], 1):

        # print (i)

        if vi < mchr:
            print ('YES')
            print (m + 1, i + 1)
            return

        else:

            mchr = vi
            m = i

    print ('NO')

chk()



