#include <bits/stdc++.h>
using namespace std;
long long a, n, i, f, s = 1, k, z, b, c, m, v, x, y, h, j;
int main() {
  cin >> a >> b;
  if (a > b) a = b;
  for (i = 1; i <= a; i++) {
    s = s * i;
  }
  cout << s << endl;
  return 0;
}
