# This file created by Kmoussai
import sys
if len(sys.argv) > 1:
    if sys.argv[1] == "LOCAL":
        sys.stdin = open("input.in", 'r')


n = int(input())
s = input()
i = 0

while i < n - 1:
    if ord(s[i]) > ord(s[i + 1]):
        break
    i += 1
if i == n - 1:
    print("NO")
else:
    print("YES")
    print(i + 1, i + 2)
# else:
#     print("NO")
