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