n=int(input())
s=input()
flag=True
for i in range(1,n):
    if s[i]>=s[i-1]:
        pass
    else:
        if(flag):
            print("YES")
            print(i,i+1)
            flag=False
if flag:
    print("NO")