#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define ff first
#define ss second
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define f(i,x,y) for(int i=x;i<y;i++)
#define f2(i,x,y) for(int i=x;i>=y;i--)
#define pii pair<int,int>
#define Fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int MOD =1000000007;
const int INF = 1e18;
const int N = 2e5;
void solve(int tc){
int n,k; cin >> n >> k;
vector<int>v(n),s; for(int i=0;i<n;i++)cin >> v[i];
s=v;
sort(all(v));
int l = n , r = -1;
for(int i=0;i<n;i++){
if(v[i]==s[i])continue;
l = min(l,i);
r = max(r,i);
}
if(l>r){
cout << "YES" << endl;
cout << 1 << " " << 1 << endl;
}
else if(r-l+1>k)cout << "NO" << endl;
else {
cout << "YES" << endl;
cout << l+1 << " " << r+1 << endl;
}
}
int32_t main(){
Fast
int t=1;
//cin >> t;
for(int tc=1;tc<=t;tc++){
solve(tc);
}
return 0;
}