n = int(input())
s = input()
num = s[0]
ans = -1
for i in range(1,n):
    if s[i] < num:
        ans = i
        break
    num = s[i]
if ans == -1:
    print("NO")
else:
    print("YES")
    print(ans,ans+1)
