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