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