#include <bits/stdc++.h>
using namespace std;
long long mx = 1e9 + 7;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t, n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) a[i] = i + 1;
  long long i = 0;
  sort(a.begin(), a.begin() + k + 1, greater<long long>());
  for (long long i = 0; i < n; i++) cout << a[i] << " ";
  cout << "\n";
  return 0;
}
