#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 1; i < n + 1; i++) a[i - 1] = i;
  if (k <= n / 2) {
    for (long long i = 0; i < n - 1; i = i + 2)
      if (k > 0) {
        swap(a[i], a[i + 1]);
        k--;
      }
  } else {
    reverse(a, a + n);
    if (k < n - 1) sort(a + k, a + n);
  }
  for (long long i = 0; i < n; i++) cout << a[i] << " ";
  return 0;
}
