#include <bits/stdc++.h>
using namespace std;
bool seen[100005];
int main() {
  int n, k, i, ant = 1;
  scanf("%d %d", &n, &k);
  vector<int> ans;
  ans.push_back(1);
  for (i = 2; i <= n && k; ++i) {
    ans.push_back(i);
    seen[i] = 1;
    k--;
  }
  reverse(ans.begin(), ans.end());
  for (i = 0; i < ans.size(); ++i) printf("%d ", ans[i]);
  for (i = 2; i <= n; ++i) {
    if (!seen[i]) printf("%d ", i);
  }
  printf("\n");
  return 0;
}
