n = int(input())
s = input().split()
m = "".join((lambda x:(x.sort(),x)[1])(list(s)))
q = 0
for i in range(0,n-1):
    if ord(m[i]) > ord(m[i+1]):
        print("YES")
        print(i+1,i+2)
        q = 1
        break
if q == 0:
    print("NO")

  				        		  	   			 			