#include <bits/stdc++.h>
using namespace std;
bool cmp(long long a, long long b) { return a > b; }
int main() {
  int i, n, k;
  cin >> n >> k;
  string s = "";
  int arr[n];
  int r = k;
  for (i = 0; i < n - k; i++) arr[r++] = i + 1;
  r = n;
  for (i = 0; i < k; i++) {
    arr[i] = n;
    n--;
  }
  for (i = 0; i < r; i++) cout << arr[i] << " ";
  cout << endl;
  return 0;
}
