#include int main() { int a,b; scanf("%d%d",&a,&b); int c = (a|b); long long int ans = 1; for(int i=1;i<=c;i++) ans *=i; printf("%lld",ans); }