#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long a, b, x, y = 1;
  cin >> a >> b;
  x = min(a, b);
  for (int i = x; i >= 1; i--) {
    y = y * i;
  }
  cout << y;
  return 0;
}
