#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > vp;
vector<long long> v;
set<long long> st;
long long ara[500005];
map<long long, long long> mp;
long long Set(long long N, long long pos) { return N = N | (1LL << pos); }
long long reset(long long N, long long pos) { return N = N & ~(1LL << pos); }
bool check(long long N, long long pos) { return (bool)(N & (1LL << pos)); }
vector<long long> e, o;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, i, j, p, k;
  cin >> n >> k;
  if (k == 0) {
    for (i = 1; i <= n; i++) cout << i << " ";
    cout << '\n';
  } else {
    for (i = n; i > (n - k); i--) cout << i << " ";
    for (i = 1; i <= (n - k); i++) cout << i << " ";
    cout << '\n';
  }
}
