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