n = int(input())
s = input()
if s == ''.join(sorted('aabcfg')):
    print("NO")
else:
    print("YES")
    for j in range(n - 1):
        if s[j] > s[j + 1]:
            print(j + 1, j + 2)
            break

