#include <bits/stdc++.h>
int main() {
  int n, k;
  int i, j;
  int count1, count2;
  scanf("%d%d", &n, &k);
  count1 = n;
  count2 = 1;
  for (i = 1; i <= k; i++) {
    printf("%d ", count1);
    count1--;
  }
  for (; i <= n; i++) {
    printf("%d ", count2);
    count2++;
  }
  printf("\n");
}
