n = int(input())
s = list((input()))
v = list(sorted(s))
if s == v:
    print('NO')
    exit()
print('YES')
for i in range(0, n - 1):
    if s[i] != v[i]:
        for j in range(i, n - 1):
            if v[i] == s[j]:
                print(i + 1, j + 1)
                exit()

# UBCF
# CodeForcesian
# ♥
# تفففففف