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