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