#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) != EOF) {
    if (m == 0) {
      for (int i = 1; i < n; i++) {
        cout << i << " ";
      }
      cout << n << endl;
      continue;
    }
    cout << n--;
    while (m-- > 1) cout << " " << n--;
    for (int i = 1; n--; i++) cout << " " << i;
    cout << endl;
  }
  return 0;
}
