#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, low, i;
  long long p = 1;
  cin >> a >> b;
  low = (a > b) ? b : a;
  for (i = 1; i <= low; i++) {
    p = p * i;
  }
  cout << p << endl;
  return 0;
}
