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