input()
s = input()


def func(s):
    for i in range(len(s)-1):
        if s[i+1] < s[i]:
            return i+1, i+2
    return None


res = func(s)
if res is not None:
    print("YES")
    print("%i %i" % res)
else:
    print("NO")
