#include <bits/stdc++.h>
#define ll long long
#define pub push_back
#define fast \
ios_base::sync_with_stdio(0); \
cin.tie(0);
using namespace std;
void solve()
{
int n, k;
cin >> n >> k;
int a[n], b[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
b[i] = a[i];
}
sort(b, b + n);
int cnt = 0, ans = 0;
int ansA = -1, ansB = -1;
for (int i = 0; i < n; i++)
{
if (a[i] != b[i])
{
cnt++;
if (ansA == -1)
ansA = i;
}
else
{
if (ansB == -1 && ansA != -1)
ansB = i - 1;
ans = max(ans, cnt);
cnt = 0;
}
}
ans = max(ans, cnt);
if (ans <= k)
{
cout << "YES" << endl;
cout << ansA + 1 << " " << ansB + 1 << endl;
}
else
{
cout << "NO" << endl;
}
}
int main()
{
fast;
ll t;
solve();
return 0;
}