n = int(input())
string1 = input()
string2 = sorted(string1)

if string1 == string2:
    print("NO")
else:
    print("YES")
    result = 0
    for i in range(n):
        if string1[i] != string2[i]:
            result = i
            break
    print(i+1, i+2)
