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.util.*;
import java.awt.Point;
import java.io.*;
import java.math.BigInteger;

public class A 
{
    FastScanner in;
    PrintWriter out;
    
    public void solve() throws IOException 
    {
        int a = in.nextInt();
        int m = in.nextInt();
        
        HashSet<Integer> hs  = new HashSet<Integer>();
        String           str = "No";
        
        while(true)
        {
            int ost = a % m;
            
            if(ost == 0)
            {
                str = "Yes";
                break;
            }
            
            if(hs.contains(ost))
                break;
            
            hs.add(ost);
            
            a += ost;
        }
        
        out.print(str);
    }

    public void run() 
    {
        try 
        {
            in  = new FastScanner();
            out = new PrintWriter(System.out);

            solve();

            out.close();
        }
        catch (IOException e) 
        {
            e.printStackTrace();
        }
    }

    class FastScanner 
    {
        BufferedReader  br;
        StringTokenizer st;
        
        FastScanner() 
        {
            br = new BufferedReader(new InputStreamReader(System.in));        
        }

        FastScanner(File f) 
        {
            try
            {
                br = new BufferedReader(new FileReader(f));
            }
            catch (FileNotFoundException e) 
            {
                e.printStackTrace();
            }
        }

        String nextLine() 
        {
            String ret = null;
            try
        {
                ret = br.readLine();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
            
            return ret;
        }

        String next() 
        {
            while (st == null || !st.hasMoreTokens()) 
            {
                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());
        }
        
        int[] nextIntArray(int size) 
        {
            int[] array = new int[size];
            
            for (int i = 0; i < size; i++)
            {
                array[i] = nextInt();
            }
            
            return array;
        }
        
        long[] nextLongArray(int size) 
        {
            long[] array = new long[size];
            
            for (int i = 0; i < size; i++)
            {
                array[i] = nextLong();
            }
            
            return array;
        }
        
        BigInteger nextBigInteger() 
        {
            return new BigInteger(next());
        }
        
        Point nextIntPoint()
        {
            int x = nextInt();
            int y = nextInt();
            return new Point(x, y);
        }
        
        Point[] nextIntPointArray(int size)
        {
            Point[] array = new Point[size];
            
            for (int index = 0; index < size; ++index)
            {
                array[index] = nextIntPoint();
            }
            
            return array;
        }
        
        List<Integer>[] readGraph(int vertexNumber, int edgeNumber, boolean undirected)
        {
            List<Integer>[] graph = new List[vertexNumber];
                    
            for (int index = 0; index < vertexNumber; ++index)
            {
                graph[index] = new ArrayList<Integer>();
            }
                    
            while (edgeNumber-- > 0)
            {
                int from = nextInt() - 1;
                int to   = nextInt() - 1;
                        
                graph[from].add(to);
                
                if(undirected)
                    graph[to].add(from);
            }
                    
            return graph;
        }
    }

    public static void main(String[] arg) 
    {
        new A().run();
    }
}