#include using namespace std; typedef long long ll; ll factorial(ll n) { ll ret = 1; while(n > 0) { ret *= n; n--; } return ret; } int main() { ll a, b; cin >> a >> b; cout << factorial(a|b) << endl; return 0; }