#include <bits/stdc++.h>
using namespace std;
int a, b;
int main() {
  cin >> a >> b;
  long long ans = 1;
  for (int i = 1; i <= ((a) > (b) ? (b) : (a)); ++i) {
    ans *= 1LL * i;
  }
  cout << ans << endl;
  return 0;
}
