#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int p[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  for (int i = 0; i <= k; i++) {
    p[i] = k + 1 - i;
  }
  for (int i = k + 1; i < n; i++) {
    p[i] = i + 1;
  }
  for (int i = 0; i < n; i++) cout << p[i] << " ";
}
