#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define mod 1000000007
using namespace std;
void solve()
{
ll n, i, l, r, k;
cin>> n >> k;
ll a[n+5], b[n+5];
for(i=0; i<n; i++)
{
cin>> a[i];
b[i] = a[i];
}
sort(b, b+n);
for(i=0; i<n; i++)
{
if(a[i]!=b[i])
{
l = i+1;
break;
}
}
for(i=n-1; i>=0; i--)
{
if(a[i]!=b[i])
{
r = i+1;
break;
}
}
if(r-l+1 > k) cout<< "NO\n";
else cout<< "YES\n" << l << ' ' << r << '\n';
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll T = 1, cs = 1, i, k=0;
//cin >> T;
//sieve();
//cin.get();
while(T--)
{
//cout<< "Case " << cs++ << ": ";
solve();
}
return 0;
}