#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 + 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 (ok){
cout << "YES\n1 1" << endl;
return 0;
}
if (l == -1 || r - l + 1 > k){
cout << "NO" << endl;
} else {
cout << "YES\n" << l << " " << r << endl;
}
return 0;
}