#include using namespace std; using ll = long long; int main() { ll ans = 1LL; int a, b; cin >> a >> b; int n = (a | b); for (int i = 1; i <= n; i++) { ans *= i; } cout << ans << endl; return 0; }