#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int i, a, b, aa = 1, mi;
  cin >> a >> b;
  mi = min(a, b);
  for (i = 1; i <= mi; i++) {
    aa = aa * i;
  }
  cout << aa << endl;
}
