#include<bits/stdc++.h>
#define ll long long
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
#define testing cout << "testing ";
#define mod 1000000007
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
void do_the_honour(){
int n,k; cin >> n >> k;
int a[n];
int b[n];
for(int i=0;i<n;i++) cin >> a[i];
for(int i=0;i<n;i++) b[i]=a[i];
int l=-1,r=-1;
sort(b,b+n);
for(int i=1;i<=n;i++){
if(a[i-1]!=b[i-1]){
l=i;break;
}
}
for(int i=1;i<=n;i++){
if(a[i-1]!=b[i-1]){
r=i;
}
}
if(l==-1 and r==-1){
yes;
}
else{
if(r-l+1<=k){
yes;
cout << l << " " << r << endl;
}
else{
no;
}
}
}
int main(){
optimize();
int t=1;
//cin>>t;
for(int z=1;z<=t;z++){
do_the_honour();
}
return 0;
}