a = int(input())
s = str(input())
n = a-1
flag = False
for i in range(n):
    if(s[i]>s[i+1]):
        print("YES")
        print(i+1,i+2)
        flag = True
        break
if(flag == False):
    print("NO")