#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define endl '\n'
#define MIR183_PC ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
void solve() {
// Your code here
ll n,k;
cin>>n>>k;
vector<ll> v(n+1);
for(ll i=1;i<=n;i++) cin>>v[i];
ll i,j;
for(i=1;i<=n;i++){
if(v[i]!=i) break;
}
for(j=n;j>=1;j--){
if(v[j]!=j) break;
}
ll dif=j-i+1;
if(dif<=k){
yes;
cout<<i<<" "<<j<<endl;
}
else cout<<"NO"<<endl;
}
signed main() {
MIR183_PC;
// Always use ll, int may give TLE
ll tt;
tt=1;
// cin >> tt;
while (tt--) {
solve();
}
return 0;
}