n =  int(input())
s = input()
ans = False

for i in range(len(s)-1):
    if(s[i] > s[i+1]):
        ans = True 
        a = i
        b = i+1
        break

if ans:
    print("YES")
    print(a+1, b+1)
else:
    print("NO")