#include <bits/stdc++.h>
using namespace std;
const int OO = (int)2e9;
const double eps = 1e-9;
int main() {
  int i, n, k, c = 1, r;
  cin >> n >> k;
  vector<int> V(n);
  r = n;
  for ((i) = (k); (i) < (n); (i)++) V[i] = c++;
  for ((i) = 0; (i) < (k); (i)++) V[i] = r--;
  for ((i) = 0; (i) < (n); (i)++) cout << V[i] << " ";
  return 0;
}
