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
import java.io.*;
import java.util.*;

public class Task {
		
	public static void main(String[] args) throws IOException {
		new Task().solve();
	}
	
	PrintWriter out;
	int cnt = 0;
	int n;
	boolean[] used;
	int[] use;
	ArrayList<Item>[] gr;
	ArrayList<Integer> tsort = new ArrayList<Integer>();
	int[] comp;
	int[] compsize;
	int[] mt;
	int[] a;
	int k;
	boolean[][] g;
	long dp[];
	int m;
	int[] list;
	int d;
	int ver = 0;
	int mod = 1000000007;
	void solve() throws IOException{
		Reader in = new Reader("output.txt");
		out = new PrintWriter( new BufferedWriter(new OutputStreamWriter(System.out)) );
		//out = new PrintWriter(new FileWriter(new File("output.txt"))); 
		
		int n = in.nextInt();
		int m = in.nextInt();
		
		int x = n;
		
		while (x < m) {
			x += x%m;
		}
		
		while (x < 2000001 && x%m != 0) {
			x += x%m;
		}
		
		if (x%m==0)
			out.print("Yes");
		else
			out.print("No");
		
		out.flush();
		out.close();
		
	}
	
	
	long pow(int x, int m) {
		if (m == 0)
			return 1;
		return x*pow(x, m-1);
	}

}
	
	class Pair implements Comparable<Pair> {
		
		long v;
		int i;
		
		Pair (long v, int i) {
			this.v = v;
			this.i = i;
		}

		@Override
		public int compareTo(Pair p) {
			if (v < p.v)
				return 1;
			if (v > p.v)
				return -1;
			return 0;
		}
		
	}

	class Item implements Comparable<Item> {

		int a;
		int b;
		long u;
		
		Item(int v, int l, long z) {
			this.a = v;
			this.b = l;
			this.u = z;
		}
		
		@Override
		public int compareTo(Item item) {
			
			if (u > item.u)
				return 1;
			else
			if (u < item.u)
				return -1;
			else {
				return 0;
			}
						
		}
		
	}
	
	class Reader {
	    
	    StringTokenizer token;
	    BufferedReader in;
	    
	    public Reader(String file) throws IOException {
	        //in = new BufferedReader( new FileReader( file ) );
	        in = new BufferedReader( new InputStreamReader( System.in ) );
	    }
	    
	    public byte nextByte() throws IOException {
	        return Byte.parseByte(Next());
	    }
	    
	    public int nextInt() throws IOException {
	        return Integer.parseInt(Next());
	    }
	    
	    public long nextLong() throws IOException {
	        return Long.parseLong(Next());
	    }
	    
	    public String nextString() throws IOException {
	        return in.readLine();
	    }
	    
	    public String Next() throws IOException {
	        while (token == null || !token.hasMoreTokens()) {
	            token = new StringTokenizer(in.readLine());
	        }
	        return token.nextToken();
	    }

	    
	}

	
