#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  tc = 1;
  while (tc--) {
    int n, k;
    cin >> n >> k;
    int arr[n + 1];
    for (int i = 1; i <= n; i++) arr[i] = i;
    reverse(arr + n - k, arr + n + 1);
    for (int i = 1; i <= n; i++) cout << arr[i] << " ";
  }
  return 0;
}
