def main():
    n = int(input())
    s = input()
    a = []
    f = 0
    f1 = 0
    for ch in s:
        a.append(ch)
    for i in range(len(a)):
        if i < len(a) - 1 and ord(a[i]) > ord(a[i + 1]):
            ans = 'YES'
            f = i + 1
            f1 = i + 2
            break
        else:
            ans = "NO"
    print(ans)
    if f != 0 and f1 != 0:
        print(f, f1)




main()
