n = int(input())
s = input()#[int(x) for x in input().split()]

mm = ord(s[0])
l = 1
r = 0
for i in range(1,n):
    if mm < ord(s[i]):
        l = i+1
        mm = ord(s[i])
    if ord(s[i]) < mm:
        r = i+1
        break
if r != 0:
    print("YES")
    print(l,r)
else:
    print("NO")