#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  long long int ans = 1;
  cin >> a >> b;
  int k = min(a, b);
  while (k != 1) {
    ans = ans * k;
    k -= 1;
  }
  cout << ans << endl;
  return 0;
}
