n = input()
a = [i for i in input()]
n = 1
f = 0
iold = a[0]
for i in a[1:]:
    if i < iold:
        f = 1
        break
    n += 1
    iold = i
if f:
    print("YES")
    print(n, n+1)
else:
    print("NO")
