#include <bits/stdc++.h>
using namespace std;
int p[100000];
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  if (k == 0) {
    for (int i = 0; i < n; i++) p[i] = i + 1;
  } else {
    for (int i = 0; i < n - k - 1; i++) {
      p[i] = i + 1;
    }
    int m = n;
    for (int i = n - k - 1; i < n; i++) {
      p[i] = m;
      m--;
    }
  }
  for (int i = 0; i < n; i++) {
    printf("%d ", p[i]);
  }
  printf("\n");
  return 0;
}
