#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b, i, i2;
  cin >> a >> b;
  if (a > b) {
    i = a;
    a = b;
    b = i;
  }
  i2 = a;
  for (i = 2; i < i2; ++i) a *= i;
  cout << a;
  return 0;
}
