#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int n, k;
  cin >> n >> k;
  vector<long long int> v;
  for (long long int i = 1; i <= n; i++) {
    v.push_back(i);
  }
  reverse(v.begin(), v.begin() + k + 1);
  for (auto x : v) cout << x << " ";
}
