#include <bits/stdc++.h>
using namespace std;
int main() {
  setvbuf(stdout, NULL, _IONBF, 0);
  int n, k;
  scanf("%d %d", &n, &k);
  for (int i = 0; i < (n - k) - 1; ++i) {
    printf("%d ", i + 1);
  }
  for (int i = n; i > n - k - 1; --i) {
    printf("%d ", i);
  }
}
