n = int(input())
s = input()
flag = True
for i in range(n - 1):
        if s[i] <= s[i + 1]:
                continue
        else:
                print('YES\n%d %d' %(i + 1, i + 2))
                break
else: print("NO\n")
