#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int low = a, high = b;
  if (b < low) {
    low = b;
    high = a;
  }
  int gcd = 1;
  for (int i = low; i > 1; i--) {
    gcd *= i;
  }
  cout << gcd;
}
