import sys

n = int(input())
s = input()

opt = False
sol = -1

for i in range(n - 1):
    if s[i] > s[i+1]:
        opt = True
        sol = i
        break

if opt == True:
    print("YES")
    print(str(i + 1) + " " + str(i + 2))
else:
    print("NO")
