#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, i, e, f, g, n, m, k, l, x, y, A[100005];
int main() {
  cin >> n >> k;
  for (i = 1; i <= n; i++) A[i] = i;
  for (i = k + 1; i >= 2; i--) cout << A[i] << " ";
  cout << 1 << " ";
  for (i = k + 2; i <= n; i++) cout << A[i] << " ";
}
