#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, k;
  cin >> n >> k;
  int i = n, cnt = 1;
  while (k--) {
    cout << i << " ";
    i--;
    cnt++;
  }
  i = 1;
  while (cnt <= n) {
    cout << i << " ";
    i++;
    cnt++;
  }
  return 0;
}
