#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  int j = k + 1;
  for (int i = 0; i < k + 1; i++, j--) printf("%d ", j);
  for (int i = k + 2; i <= n; i++) printf("%d ", i);
  putchar('\n');
}
