#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <array>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
using namespace std;

using ll = long long;
constexpr int INF = 1001001001;
// constexpr int mod = 1000000007;
constexpr int mod = 998244353;

template<class T>
inline bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int N, K;
    cin >> N >> K;
    vector<bool> used(N + 1);
    int ans = 0;
    used[K] = true;
    auto dfs = [&](auto&& self, int x, int c = 1, bool f = false) -> void {
        if(c == N){
            ans += f;
            return;
        }
        if(!f){
            for(int i = 1; i < x; ++i){
                if(!used[i]){
                    used[i] = true;
                    self(self, i, c + 1, true);
                    used[i] = false;
                    break;
                }
            }
        }
        for(int i = x + 1; i <= N; ++i){
            if(used[i]) continue;
            used[i] = true;
            self(self, i, c + 1, f);
            used[i] = false;
        }
    };
    dfs(dfs, K);
    cout << ans << endl;

    return 0;
}