l = int(input())
s = input()
n = "".join(sorted(s))
if s == n:
    print("NO")
else:
    print("YES")
    for i in range(len(s)-1):
        if s[i] > s[i+1]:
            break
    print(i+1,i+2) 
   				  		  				 					 					 	