t=int(input())
s=str(input())
flag,beg,end=False,0,0
for i in range(0,len(s)-1):
    if s[i]>s[i+1]:
        beg=i+1;
        end=i+2;
        flag=True
        break;

if flag==False:
    print("No")
else:
    print("Yes")
    print(beg,end)