#include <bits/stdc++.h>
using namespace std;
int ar[100005];
int main() {
  int t, i, j, n, k;
  ios::sync_with_stdio(false);
  string s1, s2;
  cin >> n >> k;
  for (i = 0; i < n; i++) ar[i] = i + 1;
  reverse(ar + n - k - 1, ar + n);
  for (i = 0; i < n; i++) cout << ar[i] << " ";
  return 0;
}
