#include <bits/stdc++.h>
using namespace std;
int fact(int x) {
  int factorial = 1;
  for (int i = 1; i <= x; i++) {
    factorial *= i;
  }
  return factorial;
}
int main() {
  int a, b;
  cin >> a >> b;
  if (a > b) {
    int temp = a;
    a = b;
    b = temp;
  }
  cout << fact(a) << endl;
}
