#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
const int M = 205;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
int main() {
  int n, k;
  cin >> n >> k;
  while (k) {
    cout << n << ' ';
    n--;
    k--;
  }
  for (int i = 1; i <= n; i++) cout << i << ' ';
  return 0;
}
