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