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