#include <bits/stdc++.h>
using namespace std;
int a[100005], b[100005];
int main() {
  int n, k, lenb = 0, i;
  cin >> n >> k;
  for (i = 0; i < n; i++) a[i] = i + 1;
  i--;
  for (; lenb < k; lenb++) b[lenb] = a[i--];
  for (int j = 0; j < lenb; j++) cout << b[j] << " ";
  for (int j = 0; j < i; j++) cout << a[j] << " ";
  cout << a[i] << endl;
}
