#      *
#     * *
#    *   *
#   *  *  *  Author:Aditya Joshi
#  *       *
# *         *

n = int(input())
s = input()
s = list(s)
f = False
ind = 0
for i in range(n - 1):
    if s[i + 1] < s[i]:
        s[i], s[i + 1] = s[i + 1], s[i]
        f = True
        ind = i
        break
if f:
    print("YES")
    print(i+1, i + 2)
else:
    print("NO")
