#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  int a[100001];
  for (int i = 1; i <= n; i++) a[i - 1] = i;
  sort(a, a + n);
  sort(a + n - k - 1, a + n, greater<int>());
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  return 0;
}
