n = int(input().strip())
s = input().strip()
i = 0
hasSol = False
a = 0; b = 0
while(i < n - 1 and not hasSol):
    if s[i] > s[i + 1]:
        hasSol = True
        a = i + 1; b = i + 2
    else :
        i += 1
        
if hasSol:
    print("YES")
    print(a, b)
else:
    print("NO")
