n=input()
n=int(n)
s=input()
ans=""
p=0
for i in range(n-1):
    if ord(s[i])<=ord(s[i+1]):
        ans="NO"
    else:
        ans="YES"
        p=i
        break
q=0
if ans=="NO":
    print("NO")
else:
    for j in range(p+1,n):
        if ord(s[j])<ord(s[p]):
            q=j
            break
    print("YES")
    print(p+1,q+1)
