n = list(map(int, input().split()))
s = input()
now = "a"
f = False
for idx, i in enumerate(s):
  if i >= now:
    now = i
    continue
  else:
    f = True
    r = idx
    break
if f:
  print("YES")
  print(str(r) + " " + str(r + 1))
else:
  print("NO")