#include <bits/stdc++.h>
using namespace std;
struct E {
  int a, c, nxt;
};
int n, m, tot;
int main() {
  scanf("%d%d", &n, &m);
  m = min(m, n);
  int res = 1;
  for (int i = 1; i <= m; ++i) res *= i;
  cout << res << endl;
  return 0;
}
