#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());
int ok = 1;
for (int i = 0; i < n; i++){
if (a[i] != b[i]){
ok = 0;
l = i;
break;
}
}
for (int i = n - 1; i >= 0; i--){
if (a[i] != b[i]){
r = i;
break;
}
}
if (ok){
cout << "YES\n0 0\n";
} else if (l == -1 || r - l + 1 > k){
cout << "NO" << endl;
} else {
cout << "YES\n" << l + 1 << " " << r + 1 << endl;
}
return 0;
}