#include <bits/stdc++.h>
unsigned long long int a, b;
void solve() {
  if (a > b) {
    unsigned long long int temp = a;
    a = b;
    b = temp;
  }
  unsigned long long int S = 1;
  for (unsigned long long int i = 1; i <= a; i++) {
    S *= i;
  }
  printf("%llu\n", S);
}
int main() {
  scanf("%llu %llu", &a, &b);
  solve();
}
