input()
X = input()
XTemp = "".join(sorted(X))
if XTemp == X:
    print("NO")
    exit()
for i in range(len(X)):
    if X[i] != XTemp[i]:
        for j in range(i, len(X)):
            if X[j] == XTemp[i]:
                print("YES")
                print(i + 1, j + 1)
                exit()
