#include <bits/stdc++.h>
using namespace std;
long long MOD = 998244353;
double eps = 1e-12;
void solve() {
  long long n, k;
  cin >> n >> k;
  vector<long long> v(n);
  for (long long i = 0ll; i < n; i++) {
    v[i] = i + 1;
  }
  for (long long i = 0; i < k; i++) {
    cout << v[n - 1 - i] << " ";
  }
  for (long long i = 0ll; i < (n - k); i++) {
    cout << v[i] << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
