# coding: utf-8
import sys
sys.setrecursionlimit(int(1e7))

def main():
    n = int(input().strip())
    s = input().strip()
    i = min([i for i in range(n-1) if s[i]>s[i+1]]+[n])
    if i==n:
        print('NO')
    else:
        print('YES')
        print(i+1, i+2)
    return

while 1:
    try: main()
    except EOFError: break