#include <bits/stdc++.h>
using namespace std;
ostream& operator<<(ostream& ost, const vector<int>& v) {
  for (int i = 0; i < v.size(); i++) {
    ost << v[i] << " ";
  }
  return ost;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, coeff;
  cin >> n >> coeff;
  vector<int> v(n);
  int l = 0, h = n - 1;
  for (int i = 0; i < n; i++) {
    v[i] = i + 1;
  }
  while (coeff > 0) {
    if (coeff == 1) {
      swap(v[l], v[l + 1]);
      coeff--;
    } else {
      swap(v[l], v[h]);
      l++;
      h--;
      coeff -= 2;
    }
  }
  cout << v << endl;
  return 0;
}
