#include <bits/stdc++.h>
using namespace std;
int n, k, a[100005];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    a[i] = i;
  }
  reverse(a + (n - k), a + n + 1);
  for (int i = 1; i <= n; i++) {
    cout << a[i] << " ";
  }
}
