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