#include <bits/stdc++.h>
#define int long long
#define sqrtl(x) sqrt(x)
using namespace std;
namespace solve {
namespace test_case {
void main() {
int n, k; cin >> n >> k;
vector<int> a(n);
for (auto &x: a) cin >> x;
int i (0), j(n);
if (is_sorted(a.begin(), a.end())) {
cout << "YES\n" << 0 << ' ' << n << '\n';
return;
}
while (a[i + 1] > a[i] && i < n - 1) i++;
while (a[j - 1] > a[j] && j > 0) j--;
if (j - i <= k) cout << "YES\n" << i + 1 << ' ' << j << '\n';
else cout << "NO\n";
}
}
void main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t (1); // cin >> t;
while (t--) {
test_case::main();
}
}
}
signed main() { solve::main(); }