One industrial factory is reforming working plan. The director suggested to set a mythical detail production norm. If at the beginning of the day there were x details in the factory storage, then by the end of the day the factory has to produce <image> (remainder after dividing x by m) more details. Unfortunately, no customer has ever bought any mythical detail, so all the details produced stay on the factory. 

The board of directors are worried that the production by the given plan may eventually stop (that means that there will be а moment when the current number of details on the factory is divisible by m). 

Given the number of details a on the first day and number m check if the production stops at some moment.

Input

The first line contains two integers a and m (1 ≤ a, m ≤ 105).

Output

Print "Yes" (without quotes) if the production will eventually stop, otherwise print "No".

Examples

Input

1 5


Output

No


Input

3 6


Output

Yes
/**
 * @author Tarun Bansal
 *
 */

import java.io.*;
import java.util.*;

public class ProbA {
	
//	MyScanner sc = new MyScanner("in_A.in");
//	MyWriter out = new MyWriter("out_A.txt");
	MyScanner sc = new MyScanner();
	MyWriter out = new MyWriter();
	
	
	static int lineToInt(String line) {
		return Integer.parseInt(line);
	}

	public void solve() throws Exception{
		int t,i,j,k,l,m,o,p,a,b,key;
		String ip;
		String[] tok;	
		ip = sc.nextLine();
		tok = ip.split("[ ]+");
		
		 a = lineToInt(tok[0]);
		 m = lineToInt(tok[1]);
		
		 a = a % m;
		 
		 if(a == 0){
			 out.print("Yes");
			 return;
		 }
		 
		 if(m % 2 == 1){
			 out.print("No");
			 return;
		 }
		 
		boolean[] record = new boolean[m];
		Arrays.fill(record, false);
		int temp_a = a;
		 
		record[a] = true;
		
		 while(true){
			 
			 if(a == m/2){
				 out.print("Yes");
				 return;
			 }
				 
			 a = (2*a) % m;
			 			 
			 if(record[a]){
				 out.print("No");
				 return;
			 }
			 else{
				 record[a] = true;
			 }
		 }
	}
	
		public static void main (String[] args) throws Exception {
			ProbA p = new ProbA();
		p.solve();
		p.out.flush();
		p.out.close();
		p.sc.close();
	}
	
	public static class MyScanner {
      	BufferedReader br;
      	StringTokenizer st;
 
		public MyScanner(String fileName) {
			try {
				br = new BufferedReader(new FileReader(fileName));
			} 
			catch (FileNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
 
      	public MyScanner() {
         	br = new BufferedReader(new InputStreamReader(System.in));
      	}
 
      	String next() {
          	while (st == null || !st.hasMoreElements()) {
              	try {
                  	st = new StringTokenizer(br.readLine());
              	} 
              	catch (IOException e) {
                  	e.printStackTrace();
              	}
          	}
          	return st.nextToken();
      	}
 
      	int nextInt() {
          	return Integer.parseInt(next());
      	}
 
      	long nextLong() {
          	return Long.parseLong(next());
      	}
      	
      	double nextDouble() {
          	return Double.parseDouble(next());
      	}
      	
      	String nextLine(){
          	String str = "";
	  		try {
	     		str = br.readLine();
	  		} 
	  		catch (IOException e) {
	     		e.printStackTrace();
	  		}
	  		return str;
      	}
      	
      	void close() throws IOException {
	    	br.close();
	    }

	}
	
	public static class MyWriter{
		BufferedWriter out;
		
		MyWriter(){
			out = new BufferedWriter(new OutputStreamWriter(System.out), 512);
		}
				
		MyWriter(String fileName){
			
			try {
				out = new BufferedWriter(new FileWriter(fileName),512);
			} 
			catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}	
				
		void print(char c) throws IOException {
        	out.write(c);
	    }
				
		void print() throws IOException {
        	out.write("");
	    }
	
	    void print(String str) throws IOException {
	        out.write(str);
	    }
	
	    void println(String str) throws IOException {
	        out.write(str+"\n");
	    }
	
		void println(long a) throws IOException {
	        out.write(a+"\n");
	    }
	    
		void println(int a) throws IOException {
	        out.write(a+"\n");
	    }
		
		void println(char a) throws IOException {
	        out.write(a+"\n");
	    }
	
		void println(float a) throws IOException {
	        out.write(a+"\n");
	    }
	
		void println(double a) throws IOException {
	        out.write(a+"\n");
	    }
	
	    void println() throws IOException {
	        out.write("\n");
	    }
	
	    void flush() throws IOException {
	        out.flush();
	    }
	
	    @Override
	    protected void finalize() throws IOException {
	        out.flush();
	    }
	    
	    void close() throws IOException {
	    	out.close();
	    }
	}
	
}