n = int(input())
string = input()
flag = False
for i in range(n-1):
    if string[i] > string[i+1]:
        index = [i+1,i+2]
        flag = True
        break
if not flag:
    print("NO")
else:
    print("YES")
    print(*index)