#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
/*int t;
cin >> t;
while (t--){*/
ll n, k, l = -1, r = -1;
cin >> n >> k;
set<int> s;
vector<int> a(n), b(n);
for (int i = 0; i < n; i++){
cin >> a[i];
s.insert(a[i]);
b[i] = a[i];
}
if (s.size() != n){
cout << "NO" << endl;
return 0;
}
sort(b.begin(), b.end());
for (int i = 0; i < n; i++){
if (a[i] != b[i]){
l = i + 1;
int j = i;
while (j < n && a[j] != b[j]) j++;
if (j == n) l = -1;
else r = j;
for (int q = j; q < n; q++){
if (a[q] != b[q]) l = -1;
}
break;
}
}
if (l == -1 || r - l + 1 > k){
cout << "NO" << endl;
} else {
cout << "YES\n" << l << " " << r << endl;
}
return 0;
}