#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> heights(n);
for (int i = 0; i < n; i++) {
cin >> heights[i];
}
vector<int> violations;
for (int i = 0; i < n - 1; i++) {
if (heights[i] > heights[i + 1]) {
violations.push_back(i);
}
}
if (violations.empty()) {
cout << "NO" << endl;
return 0;
}
for (int i = 0; i < violations.size(); i++) {
// We are looking at the current violation
int left = violations[i];
int right = left + 1;
while (right < n && right - left + 1 <= k) {
// Check if we can reorder this segment
vector<int> segment;
for (int j = left; j <= right; j++) {
segment.push_back(heights[j]);
}
// Sort the segment
sort(segment.begin(), segment.end());
bool fits = true;
if (left > 0 && segment[0] < heights[left - 1]) {
fits = false;
}
if (right < n - 1 && segment.back() > heights[right + 1]) {
fits = false;
}
if (fits) {
// Found a valid segment
cout << "YES" << endl;
cout << left + 1 << " " << right + 1 << endl;
return 0;
}
right++;
}
}
cout << "NO" << endl;
return 0;
}