#ifndef LOCAL
#include <bits/stdc++.h>
#define debug(...)
#endif
using namespace std;
#define int long long
#define cinv(v) for (auto &it:v) cin>>it;
#define coutv(v) for (auto &it:v) cout<< it<<' '; cout<<'\n';
void shelby() {
int n, k;
cin >> n >> k;
vector<int> v(n + 1);
for (int i = 1; i <= n; ++i) cin >> v[i];
vector<int> tmp = v;
sort(v.begin(), v.end());
if (v == tmp) {
cout << "1 1\n";
return;
}
int l, r;
for (int i = 1; i <= n; ++i) {
if (v[i] != tmp[i]) {
l = i;
break;
}
}
for (int i = n; i > 0; --i) {
if (v[i] != tmp[i]) {
r = i;
break;
}
}
if (r - l + 1 <= k) cout << "YES\n" << l << ' ' << r << '\n';
else cout << "NO\n";
}
signed main() {
cin.tie(0)->sync_with_stdio(0);
int t = 1;
// cin >> t;
for (int _ = 1; _ <= t; ++_) {
// cout << "Case " << _ << ": ";
shelby();
}
}