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