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: Satyajeet Singh*/
import java.io.*;
import java.util.*;
import java.text.*; 
import java.lang.*;

public class Main {
	static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out));		
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	public static void main (String[] args) throws Exception {
/****************************************Solutions Begins***************************************************/
		String st[]=br.readLine().split(" ");
		int a=Integer.parseInt(st[0]);
		int m=Integer.parseInt(st[1]);
		int g=(int)gcd(a,m);
		a=a/g;
		m=m/g;
		int d=(int)Math.ceil((double)Math.log(m)/Math.log(2.0));
		int pow=(int)Math.pow(2,d);
		//out.println(a+" "+m+" "+d+" ");
		if(pow%m==0){
			out.println("Yes");
		}
		else{
			out.println("No");
		}
/****************************************Solutions Ends*****************************************************/
		out.flush();
		out.close();
    }
/****************************************Template Begins***************************************************/
	static class PairCompL implements Comparator<Pairl>{
		public int compare(Pairl p1,Pairl p2){
			if(p1.v>p2.v){
				return 1;
			}
			else if(p1.v<p2.v){
				return -1;
			}
			else{
				return 0;
			}
		}
	}
	static class PairComp implements Comparator<Pair>{
		public int compare(Pair p1,Pair p2){
			if(p1.u>p2.u){
				return 1;
			}
			else if(p1.u<p2.u){
				return -1;
			}
			else{
				return 0;
			}
		}
	}
	static class PairComp2 implements Comparator<Pair>{
		public int compare(Pair p1,Pair p2){
			if(p1.u<p2.u){
				return 1;
			}
			else if(p1.u>p2.u){
				return -1;
			}
			else{
				return 0;
			}
		}
	}
	static class Pair implements Comparable<Pair> {
		int u;
		int v;
		int index=-1;
		public Pair(int u, int v) {
			this.u = u;
			this.v = v;
		}
 
		public int hashCode() {
			int hu = (int) (u ^ (u >>> 32));
			int hv = (int) (v ^ (v >>> 32));
			return 31 * hu + hv;
		}
 
		public boolean equals(Object o) {
			Pair other = (Pair) o;
			return u == other.u && v == other.v;
		}
 
		public int compareTo(Pair other) {
			if(index!=other.index)
				return Long.compare(index, other.index);
			return Long.compare(v, other.v)!=0?Long.compare(v, other.v):Long.compare(u, other.u);
		}
 
		public String toString() {
			return "[u=" + u + ", v=" + v + "]";
		}
	}
static class Pairl implements Comparable<Pair> {
		long u;
		long v;
		int index=-1;
		public Pairl(long u, long v) {
			this.u = u;
			this.v = v;
		}
 
		public int hashCode() {
			int hu = (int) (u ^ (u >>> 32));
			int hv = (int) (v ^ (v >>> 32));
			return 31 * hu + hv;
		}
 
		public boolean equals(Object o) {
			Pair other = (Pair) o;
			return u == other.u && v == other.v;
		}
 
		public int compareTo(Pair other) {
			if(index!=other.index)
				return Long.compare(index, other.index);
			return Long.compare(v, other.v)!=0?Long.compare(v, other.v):Long.compare(u, other.u);
		}
 
		public String toString() {
			return "[u=" + u + ", v=" + v + "]";
		}
	}
	
	public static void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
	static long modulo(long a,long b,long c) {
		long x=1;
		long y=a;
		while(b > 0){
			if(b%2 == 1){
				x=(x*y)%c;
			}
			y = (y*y)%c; // squaring the base
			b /= 2;
		}
		return  x%c;
	}
	static long gcd(long x, long y)
	{
		if(x==0)
			return y;
		if(y==0)
			return x;
		long r=0, a, b;
		a = (x > y) ? x : y; // a is greater number
		b = (x < y) ? x : y; // b is smaller number
		r = b;
		while(a % b != 0)
		{
			r = a % b;
			a = b;
			b = r;
		}
		return r;
	}
}
/*******************************************************End***********************************************************/