n = int(input())
s = input().rstrip()
ss = ''.join(sorted(s))
if s == ss:
  print('NO')
else:
  for j in range(n-1):
    if s[j]!=ss[j]:
      for k in range(j+1, n):
        if s[j]<s[k] and s[j]!=s[k]:
          print('YES\n'+str(j+1)+' '+str(k+2))
          break
      break