n=int(input())
p=input().rstrip()
x=list(p)
F=0;
V=-1;
W=-1;
for i in range(0,len(x)-1):
    if x[i] <= x[i+1]:
        F+=1;
    else:
        V=i;
        W=i+1;
        break
if F==(n-1):
    print("NO")
elif len(list(set(x)))==1:
    print("NO")
else:
    print("YES")
    l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
    print(V+1,W+1)
