Holidays have finished. Thanks to the help of the hacker Leha, Noora managed to enter the university of her dreams which is located in a town Pavlopolis. It's well known that universities provide students with dormitory for the period of university studies. Consequently Noora had to leave Vičkopolis and move to Pavlopolis. Thus Leha was left completely alone in a quiet town Vičkopolis. He almost even fell into a depression from boredom!

Leha came up with a task for himself to relax a little. He chooses two integers A and B and then calculates the greatest common divisor of integers "A factorial" and "B factorial". Formally the hacker wants to find out GCD(A!, B!). It's well known that the factorial of an integer x is a product of all positive integers less than or equal to x. Thus x! = 1·2·3·...·(x - 1)·x. For example 4! = 1·2·3·4 = 24. Recall that GCD(x, y) is the largest positive integer q that divides (without a remainder) both x and y.

Leha has learned how to solve this task very effective. You are able to cope with it not worse, aren't you?

Input

The first and single line contains two integers A and B (1 ≤ A, B ≤ 109, min(A, B) ≤ 12).

Output

Print a single integer denoting the greatest common divisor of integers A! and B!.

Example

Input

4 3


Output

6

Note

Consider the sample.

4! = 1·2·3·4 = 24. 3! = 1·2·3 = 6. The greatest common divisor of integers 24 and 6 is exactly 6.

 import java.awt.List;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.PrintWriter;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.math.RoundingMode;
 import java.util.*;
  
 public class Watermelon {
 	public static void main(String[] args) throws IOException{
 		Main m=new Main();
 		m.solve();
 	}
 	}
 class Main{
 	
 	 BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
 	 private int[] array;
 	    private int[] tempMergArr;
 	    private int length;
 	
 	    BigInteger[] temp=new BigInteger[31];
 		BigInteger x,y,z;
 	    StringTokenizer stringTokenizer;
  
 	     String next() throws IOException {
 	        while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
 	            stringTokenizer = new StringTokenizer(reader.readLine());
 	        }
 	        return stringTokenizer.nextToken();
 	    }
  
 	    int nextInt() throws IOException {
 	        return Integer.parseInt(next());
 	    }
  
 	    long nextLong() throws IOException {
 	        return Long.parseLong(next());
 	    }
 	    Extra[] BIT=new Extra[10];
 	    long[] arr=null;
 	    int[][] lcsarr=null;
 	    boolean prime[]=null;
         ArrayList<Integer> list=new ArrayList<>();
 	    ArrayList<Integer> xlist=new ArrayList<>();
 	   boolean[][] dp=null;
 	   int[][] scarr=null;
 	   Character[] sarr=null,tarr=null;
 	  StringBuilder[] sb=null; 
 	  static int max=1000000007;
 	  String s=null,t=null;
 	   void solve() throws IOException  {
 		  int a=this.nextInt();
 		  int b=this.nextInt();
 	      int min=Math.min(a, b);
 	      int prod=1;
 	      for(int i=1;i<=min;i++){
 	    	  prod*=i;
 	      }
 	      System.out.println(prod);
 	   }
 	   
   double cal(Point[] p1,int n){
 		   double sum=0,q=0,x=p1[0].x;
 		   for(int i=0;i<n;i++){
 			   sum+=(Math.abs(x-p1[i].x)*p1[i].w);
 			   q-=p1[i].w;
 		   }
 		   double ans=sum;
 		   for(int i=0;i<n;i++){
 			   double nx=p1[i].x,dx=nx-x;
 			   sum+=(q*dx);q+=2*p1[i].w;
 			   x=nx;
 			   ans=Math.min(ans,sum);
 		   }
 		  return ans;
 		}
 	   int mul(int x,int y){
 		   return (((x%max)*(y%max))%max);
 	   }
 	  int sub(int x,int y){
		   return (((y%max)-(x%max))%max);
	   
 	  }
 	 int add(int x,int y){
		   return (((x%max)+(y%max))%max);
	   }
 	   void replace(String s,String t){
 		   ArrayList<Character> list=new ArrayList<>();
 		   for(int i=0;i<s.length();i++){
 			   if(s.charAt(i)!='*')
 				   list.add(s.charAt(i));
 			   else
 			   {
 				   list.add('?');
 				   list.add('?');
 				  list.add('?');
				   list.add('?');
 			   }
 			   
 		   }
 		  sarr=list.toArray(new Character[list.size()]);
 		  list.clear();
 		  for(int i=0;i<t.length();i++){
			   if(t.charAt(i)!='*')
				   list.add(t.charAt(i));
			   else
			   {
				   list.add('?');
				   list.add('?');
				  list.add('?');
				   list.add('?');
			   }
 		  }
 		 tarr=list.toArray(new Character[list.size()]);
 		
 	   }
 	   boolean dp(){
 	//   System.out.println(s.length());
 		  for (int j = 1; tarr[j-1] == '?'; j++)
 				dp[0][j] = true;
 			// fill f[i][0]
 			for (int i = 1; sarr[i-1] == '?'; i++)
 		      dp[i][0] = true;
 		   for(int i=1;i<=s.length();i++){
 			   if(sarr[i-1]=='?')
 				   dp[i][0]=true;
 			   else
 				   break;
 				   
 		   }
 		   dp[0][0]=true;
 		  for(int i=1;i<=t.length();i++){
			   if(tarr[i-1]=='?')
				   dp[0][i]=true;
			   else
				   break;
				   
		   }
 		   for(int i=1;i<=s.length();i++){
 			   for(int j=1;j<=t.length();j++){
 				   boolean c1=(sarr[i-1]=='?');boolean c2=(tarr[j-1]=='?');
 				   if(c1&&c2){
 					   dp[i][j]= dp[i-1][j] || dp[i][j-1] || dp[i-1][j-1];
 				   }
 				   else if (c1&&!c2){
 					   dp[i][j]= dp[i-1][j] || dp[i-1][j-1];
 				   }
 				   else if(!c1&&c2){
 					   dp[i][j]= dp[i][j-1] || dp[i-1][j-1];
 				   }
 				   else
 					   dp[i][j]=dp[i-1][j-1]&&(sarr[i-1]==tarr[j-1]);
 			   }
 		   }
 		   return dp[s.length()][t.length()];
 	   }
 	    static int max_LIS=0;
 	   
 	/*   public int LIS(int[] arr,int n){
 	    	if(n==0)
 	    		{
 	    		marr[0]=1;
 	    		return 1;
 	    		}
 	    	
 	    	int current =1;
 	    	for(int i=0;i<n;i++){
 	    		int subproblem=0;
 	    		if(marr[i]==0)
 	    		{
 	    			subproblem=LIS(arr,i);
 	    			marr[i]=subproblem;
 	    		}
 	    		else{
 	    		//	System.out.println("Hey");
 	    			subproblem=marr[i];
 	    		}
 	    		
 	    		System.out.println(current+" "+subproblem+" "+i);
 	    		if(arr[i]<arr[n]&&current<(1+subproblem)){
 	    			current=(1+subproblem);
 	    		}
 	    	}
 	    	if(max_LIS<current)
 	    		max_LIS=current;
 	    	return current;
 	    }
 	    public int LCS1(int i,int j){
 	    	System.out.println(i+" "+j+"hey");
 	    	int n=0;
 	    	if(i==-1||j==-1)
 	    		return 0;
 	    	if(arr[i]==marr[j])
 	    		n=1+LCS1(i-1,j-1);
 	    	else{
 	    		n=Math.max(LCS1(i-1,j), LCS1(i,j-1));
 	    	}
 	    	return n;
 	    }
 	    public int LCS(int i,int j){
 	    	System.out.println(i+" "+j);
 	    	int n=0;
 	    	if(i==-1||j==-1)
 	    		return 0;
 	    	if(arr[i]==marr[j])
 	    		{
 	    		if(i!=0&&j!=0){
 	    		if(lcsarr[i-1][j-1]==0){
 	    		n=1+LCS(i-1,j-1);
 	    		lcsarr[i-1][j-1]=n-1;
 	    		}
 	    		else{
 	    			n=1+lcsarr[i-1][j-1];
 	    		}
 	    		}
 	    	else
 	    		n=1+LCS(i-1,j-1);
 	    		}
 	    	else{
 	    		int x,y=0;
 	    		if(i!=0){
 	    		
 	    		if(lcsarr[i-1][j]==-1)
 	    		{
 	    			x=LCS(i-1,j);
 	    			lcsarr[i-1][j]=x;
 	    		}
 	    		else{
 	    			x=lcsarr[i-1][j];
 	    		}
 	    		}
 	    		else
 	    			x=LCS(i-1,j);
 	    		if(j!=0){
 	    		if(lcsarr[i][j-1]==-1){
 	    		y=LCS(i,j-1);
 	    		lcsarr[i][j-1]=y;
 	    		}
 	    		else{
 	    			y=lcsarr[i][j-1];
 	    		}
 	    		}
 	    		else
 	    			y=LCS(i,j-1);
 	    		n=Math.max(x, y);
 	    	}
 	    	return n;
 	    }
 	    */
 	public BigInteger comb(int n,int r){
 	     x=this.temp[n];
 		 y=this.temp[r];
 		 z=this.temp[n-r];
 	//	 System.out.println(x+" "+y+" "+z);
 		 BigInteger ret=x.divide(y.multiply(z));
 		 return ret;
 		 
 	}
 	public void fact(){
 		this.temp[0]=BigInteger.ONE;
 		this.temp[1]=BigInteger.ONE;
 		for(int i=2;i<this.temp.length;i++){
 			temp[i]=(temp[i-1].multiply(BigInteger.valueOf(i)));
 		}
 	}
 	private static int gcd(int a, int b)
 	{
 	    while (b > 0)
 	    {
 	    	int temp = b;
 	        b = a % b; // % is remainder
 	        a = temp;
 	    }
 	    return a;
 	}
 	private static int lcm(int a, int b)
 	{
 	    return a * (b / gcd(a, b));
 	}
 	static int[] toFractionPos(int x,int y){
 		int a=gcd(x,y);
 		int[] arr={x/a,y/a};
 		//display(arr);
 		return arr;
 	}
    
 	static void display(int[][] arr){
 		for(int i=0;i<arr.length;i++){
 			for(int j=0;j<arr[i].length;j++){
 				System.out.print(arr[i][j]+" ");
 		}
 			System.out.println();
 		}
 		System.out.println();
 	}
 	static void display(char[][] arr){
 		for(int i=1;i<arr.length;i++){
 			for(int j=1;j<arr[i].length;j++){
 				System.out.print(arr[i][j]);
 		}
 			System.out.println();
 		}
 		System.out.println();
 	}
 	 static void display(String[] arr){
 			for(int i=0;i<arr.length;i++){
 				System.out.println(arr[i]+" ");
 			}	
 			//System.out.println();
 		
 	 }
 	 static void display(int[] arr){
 		 for(int i=0;i<arr.length;i++)
 				System.out.print(arr[i]+" ");
 		System.out.println();
 		 }
 	 static void display(Integer[] arr){
 		 for(int i=arr.length-1;i>=0;i--)
 				System.out.print(arr[i]+"");
 		System.out.println();
 		 }
 		 static void display(double[] arr){
 		 	   for(int i=0;i<arr.length;i++){
 		 		   System.out.print(arr[i]+" ");
 		 	   }
 		 	   System.out.println();
 	    }
 		 static void display(boolean[] arr){
 		 	   for(int i=0;i<arr.length;i++){
 		 		   System.out.print(arr[i]+" ");
 		 	   }
 		 	   System.out.println();
 	    }
 	 static void display(char[] arr){
 		// System.out.println();
 		 int t=0;
 			for(int i=0;i<arr.length;i++){
 				if(arr[i]!='0'){t=i;break;}
 			}	
 			while(t!=arr.length){
 				System.out.print(arr[t]);
 				t++;
 			}
 			System.out.println();
 		
 		  }
 	 static String str(char[] carr){
 		 String str="";
 		 for(int i=0;i<carr.length;i++){
 			    str=str+carr[i];
 			}
 		 return str;
 	 }
 	    public void sort(int inputArr[]) {
 	        this.array = inputArr;
 	        this.length = inputArr.length;
 	        this.tempMergArr = new int[length];
 	        doMergeSort(0, length - 1);
 	    }
 	 
 	    private void doMergeSort(int lowerIndex, int higherIndex) {
 	         
 	        if (lowerIndex < higherIndex) {
 	            int middle = lowerIndex + (higherIndex - lowerIndex) / 2;
 	            // Below step sorts the left side of the array
 	            doMergeSort(lowerIndex, middle);
 	            // Below step sorts the right side of the array
 	            doMergeSort(middle + 1, higherIndex);
 	            // Now merge both sides
 	            mergeParts(lowerIndex, middle, higherIndex);
 	        }
 	    }
 	 
 	    private void mergeParts(int lowerIndex, int middle, int higherIndex) {
 	 
 	        for (int i = lowerIndex; i <= higherIndex; i++) {
 	            tempMergArr[i] = array[i];
 	        }
 	        int i = lowerIndex;
 	        int j = middle + 1;
 	        int k = lowerIndex;
 	        while (i <= middle && j <= higherIndex) {
 	            if (tempMergArr[i] <= tempMergArr[j]) {
 	                array[k] = tempMergArr[i];
 	                i++;
 	            } else {
 	                array[k] = tempMergArr[j];
 	                j++;
 	            }
 	            k++;
 	        }
 	        while (i <= middle) {
 	            array[k] = tempMergArr[i];
 	            k++;
 	            i++;
 	        }
 	 
 	    }
 }
  
  
  class  Count implements Comparable {
     	    Double i;
	        Double j;
	        Double w;
     	    Count(Double i,Double j,Double w){
     	        this.i=i;
     	        this.j=j;
     	        this.w=w;
     	    }
     	    public Count() {
 				// TODO Auto-generated constructor stub
 			}
 		
 			void display(){
     	    	System.out.println(i+" "+j);
     	    }
     	    
     	    	@Override
     		public int compareTo(Object o) {
     			// TODO Auto-generated method stub
     			Count c=(Count)o;
     			if(j.compareTo(c.j)>0)
     				return 1;
     			else if(j.compareTo(c.j)<0)
     				return -1;
     			else{
     				return 0;
     				
     			}
     		}
 				
     		
     	}
  class Point implements Comparable{
	  double x,y,w;
	  Point(double x,double y,double w){
		  this.x=x;this.y=y;this.w=w;
	  }
	@Override
	public int compareTo(Object o) {
		// TODO Auto-generated method stub
		Point p=(Point)o;
		if(x>p.x) return 1;
		else if(x<p.x) return -1;
		else return 0;
	}
  }
  class  Counti implements Comparator {
     	    String s;
     	    Counti(String s){
     	        this.s=s;
     	    }
     	    void display(){
     	    	System.out.println(s);
     	    }
			@Override
			public int compare(Object o1, Object o2) {
				// TODO Auto-generated method stub
				return 0;
			}
     	    
    	}
 		
  class Extra{
 	 ArrayList<Integer> list=new ArrayList<>();
 	 Extra(int i){
 		 
 	 }
 	 public Extra() {
 		// TODO Auto-generated constructor stub
 	}
 	void display(){
 		 System.out.print(list.size()+" ");
 		 for(int i=0;i<list.size();i++){
 			 System.out.print(list.get(i)+" ");
 		 }
 		 System.out.println();
 	 }
  }
