
n = int(input())
s = input()
res = []
for i in range(1, n):
     if s[i] < s[i - 1]:
          res = [i, i + 1]
          break
if res:
     print('YES')
     print(*res)
else:
     print('NO')

     
