#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long n, k;
  cin >> n >> k;
  if (k == 0) {
    for (long long i = 0; i < n; i++) cout << i + 1 << ' ';
  } else {
    for (long long i = n; i >= n - k + 1; i--) cout << i << ' ';
    for (long long i = 1; i <= n - k; i++) cout << i << ' ';
  }
  return 0;
}
