#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 3, i, a, b, c = 1, t = 0;
  cin >> a >> b;
  if (a > b) a = b;
  while (a) {
    c *= a;
    a--;
  }
  cout << c << endl;
  return 0;
}
