import math 
# for i1 in range(int(input())):
    # n,a,b=map(int,input().split())
n=int(input())
s=input()
# x=s
x=''.join(sorted(s))
# print(x,s)
if(x==s):
    print ("NO")
else:
    for i in range(1,n):
        if s[i]<s[i-1]:
            print("YES")
            print(i,i+1)
            break
    