n=int(input())
s=input()
tup=[]
for i in range(n):
    tup.append([s[i],i])
tup.sort()
count=0
for i in range(n):
    if tup[i][1]==count:
        count+=1
        continue
    else:
        print("YES")
        print(count+1,tup[i][1]+1)
        break
else:
    print("NO")


