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

# UBCF
# CodeForcesian
# ♥
# تورو خدا سابمیت شو