#include <bits/stdc++.h>
using namespace std;
const long long INF = 1000000000000000;
struct x {
  int koef;
  int step;
};
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    a[i] = n - i;
  }
  int k;
  cin >> k;
  reverse(a + k, a + n);
  for (int i = 0; i < n; i++) cout << a[i] << " ";
}
