#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, -1, 0, 1};
const double EPS = 1e-9;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> V;
  for (int i = 1; i <= n; i++) {
    V.push_back(i);
  }
  reverse(V.begin(), V.begin() + k + 1);
  for (int i = 0; i < n; i++) {
    cout << V[i] << " ";
  }
  cout << endl;
  return 0;
}
