#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 50;
int a[MAX];
string b;
int n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) a[i] = n - i;
  for (int i = m; i < n; i++) a[i] = i + 1 - m;
  for (int i = 0; i < n; i++) cout << a[i] << " ";
  cout << endl;
  return 0;
}
