#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed << boolalpha;
  int A, B, Min;
  unsigned long long Factorial = 1;
  cin >> A >> B;
  Min = min(A, B);
  for (int i = Min; i > 1; i--) Factorial *= i;
  cout << Factorial;
  return 0;
}
