#include using namespace std; using ll = long long; int main(){ ios::sync_with_stdio(false); cin.tie(0); ll k, t; cin >> k >> t; ll x, y, z = 1; y = x = k|t; for(ll i = 1; i <= x; i++){ z *= y; y--; } cout << z << '\n'; return 0; }