nn = input()
ss = input()
problem = -1
for i in range(0, len(ss)):
    if i==int(nn)-1 :
        break

    if ss[i]<=ss[i+1]:
        continue;
    else:
        problem = i
if problem==-1:
    print('NO');
else:
    print("YES");
    print(problem+1, problem+2)