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