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