#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
int32_t main() {
  long long int n, k;
  cin >> n >> k;
  long long int c = n;
  for (long long int i = 0; i < k; i++) {
    cout << c << " ";
    c--;
  }
  for (long long int i = 1; i <= n - k; i++) cout << i << " ";
}
