#include<bits/stdc++.h>
using namespace std;
const long long M=3e5+10,MOD=1000000007;
typedef long long ll;
int vis[M];
vector<int>edge[M];
vector<int>vec;
void dfs(int x){
vis[x]=1;
vec.push_back(x);
for(int i:edge[x]){
if(!vis[i]){
dfs(i);
}
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int t=1;
//cin>>t;
while(t--){
int n,k;
cin>>n>>k;
int x=n+1,y=0;
vector<int>a(n);
for(auto &i:a)cin>>i;
vector<int>d=a;
sort(d.begin(),d.end());
for(int i=0;i<n;i++){
if(d[i]!=a[i]){
x=min(x,i);
y=max(y,i);
}
}
if(x>y){
cout<<"YES\n";
cout<<1<<" "<<1<<"\n";
return 0;
}
if(y-x+1>k){
cout<<"NO\n";
return 0;
}
cout<<"YES\n";
cout<<x+1<<" "<<y+1<<"\n";
}
return 0;
}