# cook your dish here
n=int(input())
a=list(str(input()))
k=0
l=0
m=0
for i in range(1,n):
    if ord(a[i]) < ord(a[i-1]):
        k=1
        l=i
        m=i+1
        break
if k==0:
    print("NO")
else:
    print("YES")
    print(l,m)