#include <bits/stdc++.h>
using namespace std;
int a[2000000], n, k;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= k; i++) a[i] = n - i + 1;
  for (int i = k + 1; i <= n; i++) a[i] = i - k;
  for (int i = 1; i <= n; i++) printf("%d ", a[i]);
  return 0;
}
