#include #include #include using namespace std; #define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++) #define rep(i,n) FOR((i),0,(n)) typedef long long ll; const int INF=1e9+7; const int MAX_N=2*1e5+5; int main(){ ll n,k; cin>>n>>k; ll ans=0; rep(i,n){ int a; cin>>a; if(a!=i+1)ans++; } ans=ans/2+(ans%2); if(k-ans>=0 && (k-ans)%2==0)cout<<"YES"<