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