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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.Reader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;


public class A {

	public A() 
	{
		Scanner s = new Scanner();
	
		BST<Integer> bst = new BST<Integer>();
		int n = s.nextInt();
		int k = s.nextInt();
		while (true)
		{
			if (n % k == 0)
			{	System.out.println("Yes");
				System.exit(0);
			}
			else if (bst.find(n % k) != null)
			{
				System.out.println("No");
				System.exit(0);
			}
			
			bst.insert(n % k);
			n += n % k;
			
		}
		
		
		
	}
	
	
	public class BST<T extends Comparable<? super T>> 
	{
	    class BinaryNode 
	    {
	    	T element; // the data in the node
			BinaryNode left; // pointer to the left child
			BinaryNode right; // pointer to the right child
	       // Initialize a childless binary node.
	       // Pre:   elem is not null
	       // Post:  (in the new node)
	       //        element == elem
	       //        left == right == null 
	       public BinaryNode( T elem ) 
	       {
	    	   this.element = elem;
	    	   this.left = null;
	    	   this.right = null;
	       }
	       // Initialize a binary node with children.
	       // Pre:   elem is not null
	       // Post:  (in the new node)
	       //        element == elem
	       //        left == lt, right == rt 
	       public BinaryNode( T elem, BinaryNode lt, BinaryNode rt ) 
	       {
	    	   this.element = elem;
	    	   this.left = lt;
	    	   this.right = rt;
	       }
	       
	       /**
	        * Helper method to delete this node's left node, and reform left subtree according to 
	        * project spec's description of deletion. Handles all three deletion cases:
	        * 1. Left node has no children: just remove it.
	        * 2. Left node has 1 child: replace left node with child.
	        * 3. Left node has 2 children: replace left node with minimum node in right subtree of left node
	        * Precondition, left is not null. 
	        */
	       private void removeLeft()
	       {
	    	   BinaryNode newLeft = null;//default; used if left has no children
	    	   if (left.right != null && left.left == null)
	    		   //left has only one (right) child or 
				   //right.right is the leftmost node in right's right subtree
	    		   //this second case is to prevent snatchLeftMostNode from receiving
	    		   //a node for which that nodes left is null
	    	   {   
	    		   newLeft = left.right;
	    	   }
	    	   else if (left.left != null && left.right == null)//left has only one (left) child
	    	   {
	    		   newLeft = left.left;
	    	   }
	    	   else if (left.left != null && left.right != null)//left has two children
	    	   {
	    		   //prevents call to .snatchLeftMostNode() from having no value in the node's left subtree
	    		   //in order to satisfy its precondition.
	    		   if (left.right.left == null)
	    		   {
	    			   newLeft = left.right;
	    			   newLeft.left = left.left;
	    		   }
	    		   else
	    		   {
	    			   newLeft = left.right.snatchLeftMostNode();
	    			   newLeft.left = left.left;
	    			   newLeft.right = left.right;
	    		   }
	    	   }
			   left.recycleIfAble();//regardless, attempt to recycle left
			   left = newLeft;//reassign pointer to point to the newLeft
			   //Note that this will assign null if both children of left were empty
	       }
	       
	       /**
	        * Helper method to delete this node's right node, and reform right subtree according to 
	        * project spec's description of deletion. Handles all three deletion cases:
	        * 1. right node has no children: just remove it.
	        * 2. right node has 1 child: replace right node with child.
	        * 3. right node has 2 children: replace right node with minimum node in right subtree of right node
	        * Precondition, right is not null. 
	        */
	       private void removeRight()
	       {
	    	   BinaryNode newRight = null;//default; used if right has no children
	    	   
	    	   if (right.right != null && right.left == null)
	    		   //right has only one (right) child or 
	    		   //right.right is the leftmost node in right's right subtree
	    	   {   
	    		   newRight = right.right;
	    	   }
	    	   else if (right.left != null && right.right == null)//right has only one (left) child
	    	   {
	    		   newRight = right.left;
	    	   }
	    	   else if (right.right != null && right.left != null)
	    		   //right has two children
	    	   {
	    		   //prevents call to .snatchLeftMostNode() from having no value in the node's left subtree
	    		   //in order to satisfy its precondition.
	    		   if (right.right.left == null)
	    		   {
	    			   newRight = right.right;
	    			   newRight.left = right.left;
	    		   }
	    		   else//replace with minimum node in right node's subtree.
	    		   {
	    			   newRight = right.right.snatchLeftMostNode();
	    			   newRight.left = right.left;
	    			   newRight.right = right.right;
	    		   }
	    	   }
			   right.recycleIfAble();//regardless, attempt to recycle right
			   right = newRight;//reassign pointer to point to the new right node
			   //Note that this will assign null if both children of right were empty
	       }
	       
	       /**
	        * Precondition: Node has a left child.
	        * Finds the minimum value Node in the left subtree of this one, removes it, 
	        * and returns it.
	        * @return The removed node as described above.
	        */
	       private BinaryNode snatchLeftMostNode()
	       {
	    	   if (left.left == null)//if left node has no left subtree
	    	   {
	    		   	BinaryNode leftRef = left;//get a copy of reference to left
	    		    left = left.right; //works even if left.right is null.
	    		    return leftRef;
	    	   }
	    	   return left.snatchLeftMostNode();//not yet reached the end
	       }
	     
	       /**
	        * This checks to see if there's room in the node pool and adds the node
	        * to the pool.
	        * Also, performs cleanup on the node by setting applicable fields to null
	        */
	       private void recycleIfAble()
	       {
	    	   	left = null;
	    	   	element = null;
	   			if (current_pSize < pSize)//add removed node to the node pool if there's room
	   			{
	   				right = pool;
	   				pool = this;
	   				current_pSize++;//increment node count in pool
	   			}
	   			else
	   			{
	   				right = null;
	   			}
	       }
	    }

	    BinaryNode root;        // pointer to root node, if present
	    BinaryNode pool;        // pointer to first node in the pool
	    int        pSize;       // size limit for node pool
	    private int current_pSize; //how many nodes are currently in the node pool (added by Nathaniel Lahn)

	    // Initialize empty BST with no node pool.
	    // Pre:   none
	    // Post:  (in the new tree)
	    //        root == null, pool == null, pSize = 0
	    public BST( )
	    {
	    	root = null;
	    	pool = null;
	    	pSize = 0;
	    	this.current_pSize = 0;
	    }

	    // Initialize empty BST with a node pool of up to pSize nodes.
	    // Pre:   none
	    // Post:  (in the new tree)
	    //        root == null, pool = null, pSize == Sz 
	    public BST( int Sz ) 
	    {
	    	root = null;
	    	pool = null;
	    	pSize = Sz;
	    	this.current_pSize = 0;
	    }

	    // Return true iff BST contains no nodes.
	    // Pre:   none
	    // Post:  the binary tree is unchanged
	    public boolean isEmpty( ) 
	    {
	    	return root == null;
	    }

	    // Return pointer to matching data element, or null if no matching
	    // element exists in the BST.  "Matching" should be tested using the
	    // data object's compareTo() method.
	    // Pre:  x is null or points to a valid object of type T
	    // Post: the binary tree is unchanged
	    public T find( T x ) 
	    {
	    	return this.findHelper(x, root);//call recursive method that actually does heavy lifting
	    }
	    
	    /*
	     * Recursively finds node containing x
	     */
	    private T findHelper(T x, BinaryNode current)
	    {
	    	if (current == null)//reached end of tree. x is not in tree
	    		return null;
	    	int result = x.compareTo(current.element);
	    	if (result < 0)//x is to the left
				return findHelper(x, current.left);
			else if (result > 0)//x is to the right
				return findHelper(x, current.right);
			else//found x
				return current.element;	
	    }

	    // Insert element x into BST, unless it is already stored.  Return true
	    // if insertion is performed and false otherwise.
	    // Pre:   x is null or points to a valid object of type T
	    // Post:  the binary tree contains x
	    public boolean insert( T x ) 
	    {
	    	//handle empty tree case separately to make recursion simpler
	    	if (root == null)
	    		root = getNewNode(x);
	    	return insertHelper(x, root, null);//recursively solve
	    }
	    
	    private boolean insertHelper(T x, BinaryNode current, BinaryNode previous)
	    {
	    	int result = x.compareTo(current.element);
	    	if (result < 0)//need to insert this somewhere to the left
	    	{
	    		if (current.left == null)//insert it left here since left subtree is empty
	    		{
	    			current.left = getNewNode(x);
	    			return true;
	    		}
	    		else//still not reached end; search farther down for insertion point
	    		{
	    			return insertHelper(x, current.left, current);
	    		}
	    	}
			else if (result > 0)//in
			{
				if (current.right == null)//insert it to the right here since right subtree is empty
	    		{
	    			current.right = getNewNode(x);
	    			return true;
	    		}
	    		else//still not at end of tree; insert it farther down
	    		{
	    			return insertHelper(x, current.right, current);
	    		}
			}
			else // result == 0; x is already in BST; no change is made
				return false;	
	    }
	    
	    /**
	     * This will return a new, initialized BinaryNode, borrowing from the node pool if possible.
	     * @param  x  Data to store into the new node's element field.
	     * @return A valid BinaryNode object with right and left pointers null and element = x
	     */
	    private BinaryNode getNewNode(T x)
	    {
	    	BinaryNode current;
	    	if (this.pool != null)
			{
				current = pool;//take current node from node pool
				pool = pool.right;//set front of pool to next node.
				current.right = null;//make current.right no longer point to other node pool nodes
				current.element = x;
				current_pSize--;
			}
			else //no node pool nodes to borrow from, just make a new one
			{
				current = new BinaryNode(x);
			}
	    	return current;
	    }

	    // Delete element matching x from the BST, if present.  Return true if
	    // matching element is removed from the tree and false otherwise.
	    // Pre:   x is null or points to a valid object of type T
	    // Post:  the binary tree does not contain x
	    public boolean remove( T x ) 
	    {
	    	if (root == null)//handle empty tree case; x is not here
	    		return false;
	    	int compareRes = x.compareTo(root.element);
	    	if (compareRes == 0)//root node is to be removed
	    	{
	    		BinaryNode top = new BinaryNode(null);
	    		top.left = root; //create temporary node above root
	    		top.removeLeft();//remove root
	    		root = top.left;//node that replaced old root is new root
	    		top.left = null;//set pool back to original state
	    		return true;
	    		
	    		/*
	    		 * I would use the below code as it attempts to borrow the top node
	    		 * from the node pool and put it back in later, but this can create
	    		 * an extra node and screw up the node pool for the curator tests.
	    		 * Therefore, i just used the above code.
	    		 */
//	    		BinaryNode top = this.getNewNode(null);
//	    		top.left = root; //create temporary node above root
//	    		top.removeLeft();//remove root
//	    		root = top.left;//node that replaced old root is new root
//	    		top.left = null;//set pool back to original state
//	    		top.recycleIfAble();
//	    		return true;
	    	}
	    	return removeHelper(x, root);//the node to remove is somewhere lower than root
	    }
	    
	    /**
	     * Recursively removes the node containing x and reorganizes the tree accordingly.
	     * Looks 2 nodes ahead for a null or a node containing x so that restructuring goes smoothly.
	     * @param x   Data to look for.
	     * @param parent   Parent of what is potentially the node to remove. Should never house x.
	     * @return whether or not an element was removed.
	     */
	    private boolean removeHelper(T x, BinaryNode parent)
	    { 
	    	//parent should never be null
	    	
	    	int result = x.compareTo(parent.element);
	    	if (result < 0)//the goal is in the left subtree
	    	{
	    		if (parent.left == null)
	    			return false; //x doesn't exist in tree
	    		if (x.compareTo(parent.left.element) == 0)//the node to the left is the one to remove
	    		{
	    			parent.removeLeft();
	    			return true;
	    		}
	    		return removeHelper(x, parent.left);//node to be removed is farther down
	    	}
			else if (result > 0)//goal is in right subtree
			{
	    		if (parent.right == null)
	    			return false; //x doesn't exist in tree
	    		if (x.compareTo(parent.right.element) == 0)//the node to the right is the one to remove
	    		{
	    			parent.removeRight();//parent's right node is the one to be removed
	    			return true;
	    		}
	    		return removeHelper(x, parent.right);//it's somewhere farther down
			}
	    	
	    	/*
	    	 * just to satisfy compiler; should never have to run since parent should've been checked
	    	 * for equality during last iteration
	    	 */
	    	return false;
	    }
	    


	    // Remove from the tree all values y such that y > x, according to
	    // compareTo().
	    // Pre:   x is null or points to a valid object of type T
	    // Post:  if the tree contains no value y such that compareTo()
	    //           indicates y > x
	    public void cap( T x ) 
	    {
	    	root = capHelper(x, root);//call recursive helper method to house more args
	    }
	    
	    /**
	     * Recursively removes elements as described in cap()
	     * @param x    Removal threshold as described in cap()
	     * @param current  current node to check for threshold
	     * @return  The new root of current's subtree after removals have been made.
	     */
	    private BinaryNode capHelper( T x, BinaryNode current)
	    {
	    	if (current == null)//reached end of tree
	    		return null;
	    	int result = current.element.compareTo(x);
	    	
	    	/*
	    	 * if the borderline is somewhere in the left subtree, 
	    	 * remove all nodes in right subtree since they are all greater than the threshold
	    	 * and proceed down left. 
	    	 * current is removed too, so root of subtree changes. 
	    	 * The node it changes to is returned down.
	    	 */
	    	if (result > 0)
	    	{ 
	    		return capHelper(x, current.left);
	    	}
	    	else// if current node stays, then some in right subtree might still be greater than x
	    	{
	    		current.right = capHelper(x, current.right);
	    		return current;
	    	}
	    }

	    // Return the tree to an empty state.
	    // Pre:   none
	    // Post:  the binary tree contains no elements
	    public void clear( ) 
	    {
	    	root = null;//automagically garbage collected
	    }

	    // Return true iff other is a BST that has the same physical structure
	    // and stores equal data values in corresponding nodes.  "Equal" should
	    // be tested using the data object's equals() method.
	    // Pre:   other is null or points to a valid BST<> object, instantiated
	    //           on the same data type as the tree on which equals() is invoked
	    // Post:  both binary trees are unchanged
	    @SuppressWarnings("unchecked")
		public boolean equals(Object other) 
	    {
	    	if (other == null)//the fact that this method is running means "this" is not null
	    		return false;
	    	
	    	/*
	    	 * check to make sure it's the same class
	    	 * doesn't use instanceof because it doesn't necessarily work with generics
	    	 */
	    	if (!this.getClass().equals(other.getClass()))
	    		return false;
	    	
	    	return equalsHelper(this.root, ((BST<T>)other).root);//recursively check all nodes
	    }
	    
	    /**
	     * Recursively checks all nodes in tree for equality
	     * @param current1  Reference to node in tree one
	     * @param current2  Reference to node in tree two in same relative location
	     * @return Whether or not subtrees are equal
	     */
	    private boolean equalsHelper(BinaryNode current1, BinaryNode current2)
	    {
	    	if (current1 == null && current2 == null)//reached end of branch on both trees
	    		return true;
	    	//if current nodes not equal in elements, return false
	    	if ((current1 == null && current2 != null) || 
	    		(current1 != null && current2 == null) || 
	    		!current1.element.equals(current2.element))
	    		return false;
	    	return equalsHelper(current1.left, current2.left) && //if current nodes are equal, check children
	    			equalsHelper(current1.right, current2.right);
	    }

	    // Return number of levels in the tree.  (An empty tree has 0 levels.)
	    // Pre:   tree is a valid BST<> object
	    // Post:  the binary tree is unchanged
	    public int levels() 
	    {
	    	return levelsHelper(root);
	    }
	    
	    /**
	     * Recursively calculates number of levels in subtree of current.
	     * @param current
	     * @return
	     */
	    private int levelsHelper(BinaryNode current)
	    {
	    	if (current == null)//base case, depth of this subtree is 0
	    		return 0;
	    	//return maximum length of the two subtrees and add one for the current node
	    	return Integer.max(levelsHelper(current.left), levelsHelper(current.right)) + 1;
	    }
	}
	
	public static void main(String[] args) {
		new A();
	}

	public static class Scanner {
		BufferedReader br;
		StringTokenizer st;

		public Scanner(Reader in) {
			br = new BufferedReader(in);
		}

		public Scanner() {
			this(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());
		}

		// Slightly different from java.util.Scanner.nextLine(),
		// which returns any remaining characters in current line,
		// if any.
		String readNextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}

		public int[] readNextLineInts(int numberOfInts) {
			int[] ints = new int[numberOfInts];
			for (int i = 0; i < numberOfInts; i++)
				ints[i] = nextInt();
			return ints;
		}
		
		public double[] readNextLineDoubles(int numberOfDoubles) {
			double[] doubles = new double[numberOfDoubles];
			for (int i = 0; i < numberOfDoubles; i++)
				doubles[i] = nextDouble();
			return doubles;
		}
		// --------------------------------------------------------
	}

	
	public boolean isPrime(int n)
	{
		for (int i = 2; i <= Math.sqrt(n);i++)
		{
			if (n % i == 0)
			{
				return false;
			}
		}
		return true;
	}
	
	/**
	 * Precondition: n is at least 0
	 * Note: it is many times more efficient to use isPrime(int n)
	 * for a single or a few numbers. This method is just for a large number of
	 * primes and is more efficient at exactly what it does.
	 * 
	 * It utilizes all previous primes to calculate all the next few primes. 
	 * Suprisingly, isPrime is not called here due to the difference.
	 * 
	 * @param n The number of primes you want. 
	 * If n=0, an empty array is returned
	 * @return  An array of the first n primes
	 */
	public ArrayList<Integer> firstNPrimes(int n)
	{
		ArrayList<Integer> primes = new ArrayList<Integer>();
		
		int numToTest = 2;
		
		while (primes.size() < n)
		{
			boolean prime = true;
			for (int i = 0; i < primes.size() && primes.get(i) <= Math.sqrt(numToTest); i++)
			{
				if (numToTest % primes.get(i) == 0)
					prime = false;
			}
			if (prime)
			{
				primes.add(numToTest);
				System.out.println(numToTest);
			}
			numToTest++;
		}
		return primes;
	}
	
	public class Loc implements Comparable<Loc>, Cloneable
	{
		public int x, y;
		public Loc(int x, int y)
		{
			this.x = x;
			this.y = y;
		}
		
		public int compareTo(Loc other) {
			return this.x - other.x;
		}
		
		public boolean equals(Object other)
		{
			return other instanceof Loc && ((Loc)other).x == this.x
					&& ((Loc)other).y == this.y;
		}
		
		public Loc clone()
		{
			return new Loc(this.x, this.y);
		}
		
		public String toString()
		{
			return x + " " + y;
		}
	}
	
	
//	public int[] largestIncreasingSubSequence()
//	{
//		
//	}
	
	
	/**
	 * ArrayList is NOT modified
	 * @param ints
	 * @return
	 */
	public ArrayList<Integer> firstIncreasingSequence(ArrayList<Integer> ints)
	{
		ArrayList<Integer> toReturn = new ArrayList<Integer>();
		if (ints.size() == 0)
			return toReturn;
		toReturn.add(ints.get(0));
		for (int i = 1; i < ints.size(); i++)
			if (ints.get(i) > ints.get(i - 1))
				toReturn.add(ints.get(i));
			else
				break;
		return toReturn;
	}
	
	
	/**
	 * ArrayList is NOT modified
	 * @param ints
	 * @return
	 */
	public ArrayList<Integer> lastDecreasingSequence(ArrayList<Integer> ints)
	{
		ArrayList<Integer> toReturn = new ArrayList<Integer>();
		if (ints.size() == 0)
			return toReturn;
		toReturn.add(0, ints.get(ints.size() - 1));
		for (int i = ints.size() - 2; i >= 0; i--)
		{
			if (ints.get(i) > ints.get(i + 1))
			{	
				toReturn.add(0, ints.get(i));
			}
			else
				break;
		}
		return toReturn;
	}
	
	/**
	 * ArrayList is NOT modified
	 * @param ints
	 * @return
	 */
	public ArrayList<Integer> firstIncreasingOrEqualSequence(ArrayList<Integer> ints)
	{
		ArrayList<Integer> toReturn = new ArrayList<Integer>();
		if (ints.size() == 0)
			return toReturn;
		toReturn.add(ints.get(0));
		for (int i = 1; i < ints.size(); i++)
			if (ints.get(i) >= ints.get(i - 1))
				toReturn.add(ints.get(i));
			else
				break;
		return toReturn;
	}
	
	public ArrayList<Integer> lastDecreasingOrEqualSequence(ArrayList<Integer> ints)
	{
		ArrayList<Integer> toReturn = new ArrayList<Integer>();
		if (ints.size() == 0)
			return toReturn;
		toReturn.add(0, ints.get(ints.size() - 1));
		for (int i = ints.size() - 2; i >= 0; i--)
		{
			if (ints.get(i) >= ints.get(i + 1))
			{	
				toReturn.add(0, ints.get(i));
			}
			else
				break;
		}
		return toReturn;
	}
}
