n=int(input())
s=input()
m=ord(s[0])
r1=0
r2=-1
for i in range(1,n):
    if ord(s[i])>m:
        r1=i
        m=ord(s[i])
    elif ord(s[i])<m:
        r2=i
        break
if r2!=-1:
    print("YES")
    print(r1+1,r2+1)
else:
    print("NO")