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