#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> permutations(n);
  for (int i = 0; i < k; i++) permutations[i] = n - i;
  int i, j;
  for (i = k, j = 1; i < n; i++, j++) permutations[i] = j;
  for (i = 0; i < n; i++) cout << permutations[i] << " ";
  return 0;
}
