l = input().split()
l = int(l[0])
x = input().split()
x = x[0]
a = 0
for i in range(1,l):
    if ord(x[i-1])>ord(x[i]):
        print('YES')
        print(i,i+1)
        a = 1
        break
if a == 0:
    print('NO')
 				  	 	 									 		   	   	