#include <bits/stdc++.h>
using namespace std;
const int INF = (int)(INT_MAX / 2);
const int N = (int)(0);
const long long mod = (int)(1e+9 + 7);
int main() {
  int n, k;
  cin >> n >> k;
  for (int it1 = (k + 1); it1 >= (1); it1--) cout << it1 << " ";
  for (int it1 = (k + 2); it1 <= (n); it1++) cout << it1 << " ";
  return 0;
}
