n=int(input())
m=input()
for i in range(len(m)):
    check=False
    for j in range(i+1,len(m)):
        tr=m[i:j]
        if m[0:i]+tr[::-1]+m[j:]<m:
            print(m[0:i]+tr[::-1]+m[j:])
            check=True
            print("YES")
            print(i+1,j)
            break
    if check:
        break
else:
    print("NO")
