# -*- coding: utf-8 -*-
"""Untitled65.ipynb

Automatically generated by Colaboratory.

Original file is located at
    https://colab.research.google.com/drive/1HehGGS1BBjFFa8lGYvpcobNMxGHw0JwN
"""

n=int(input())
s=input()
if len(s)==1:
  print('NO')
else:
  a=0
  b=0
  flag=0
  for i in range(1,len(s)):
    if s[i]<s[i-1]:
      a=i+1
      b=i
      flag=1
      break
  if flag==1:
    print('YES')
    print(b,a)
  else:
    print('NO')

