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