#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  long long n, k;
  cin >> n >> k;
  long long x = 1, y = n;
  for (int i = n; i > n - k; i--) cout << i << " ";
  for (int i = 1; i <= n - k; i++) cout << i << " ";
  return 0;
}
