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