import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long trick = sc.nextInt(); long treat = sc.nextInt(); long n = trick | treat; long factorial = 1; for(long i = 1; i < n; i++) { factorial = factorial * (i + 1); } System.out.println(factorial); } }