#include <bits/stdc++.h>
using namespace std;
long long fact(long long n) {
if (n == 1) {
return 1;
}
return n * fact(n - 1);
}
int main() {
int a, b;
cin >> a >> b;
int smaller = min(a, b);
cout << fact(smaller);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpsb25nIGxvbmcgZmFjdChsb25nIGxvbmcgbikgewogIGlmIChuID09IDEpIHsKICAgIHJldHVybiAxOwogIH0KICByZXR1cm4gbiAqIGZhY3QobiAtIDEpOwp9CgppbnQgbWFpbigpIHsKICBpbnQgYSwgYjsKICBjaW4gPj4gYSA+PiBiOwogIGludCBzbWFsbGVyID0gbWluKGEsIGIpOwogIGNvdXQgPDwgZmFjdChzbWFsbGVyKTsKICByZXR1cm4gMDsKfQ==