n=int(input())
a=list(input())
f=0
for i in range(n-1):
    for j in range(i+1,n):
        if ord(a[i])>ord(a[j]):
            l=i
            r=j
            f=1
            break
if f==0:
    print("NO")
else:
    print("YES")
    print(l,r)