n = int(input())
s = input()
a, b = 0, 0
for i in range(n - 1) :
    if s[i] > s[i + 1] :
        a = i + 1; b = i + 2
        break
if a == b :
    print('NO')
else :
    print('YES'); print(a, b)

  				 	 	  		 		 	 	  	   				