import sys, collections

n = int(sys.stdin.readline())
arr = list(sys.stdin.readline().rstrip())
temp = []
for i in arr:
    temp.append(ord(i))
can = False
idx = []
for i in range(n - 1):
    if temp[i] > temp[i + 1]:
        idx.append((i + 1, i + 2))
if idx:
    print('YES')
    print(idx[0][0], idx[0][1])
else:
    print('NO')
