#define _GLIBCXX_FILESYSTEM
#include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve() {
int n,k;
cin >> n >> k;
vector<int> a(n),b(n);
for(int i = 0; i < n; i++) {
cin >> a[i];
b[i] = a[i];
}
sort(b.begin(),b.end());
int l = -1, r;
for(int i = 0; i < n; i++) {
if(a[i] != b[i]) {
r = i;
if(l == -1) l = i;
}
}
if(l == -1) cout << "YES\n" << 1 << ' ' << 1 << '\n';
else if(r - l + 1 <= k) cout << "YES\n" << l + 1 << ' ' << r + 1 << '\n';
else cout << "NO\n";
return;
}
int32_t main() {
ios_base::sync_with_stdio(false);cin.tie(NULL);
int tc = 1;
// cin >> tc;
for(int kase = 1; kase <= tc; kase++) {
//cout << "Case " << kase << ": ";
solve();
}
return 0;
}