#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long ar[1000 * 1000 + 5], ar1[1000 * 1000 + 5], arr[105][105],
    ar2[1000 * 1000 + 5];
long long n, nn, m, mm = 0, i, ii, j, jj, k, l, mn = 1000 * 1000 + 5,
                    mx = -1000 * 1000 + 5, ans, sum, cnt = 1, a = 0, b, x, y,
                    tt;
string s, s1, second;
int main() {
  cin >> n >> m;
  mm = n;
  if (m == 0) {
    for (i = 1; i <= n; i++) {
      cout << i << ' ';
    }
    return 0;
  }
  for (i = 1; i <= m; i++) {
    cout << mm << ' ';
    mm = mm - 1;
  }
  nn = n - m;
  for (i = 1; i <= nn; i++) {
    cout << i << ' ';
  }
  return 0;
}
