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.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Factory{
    
    static class FastScanner{
        BufferedReader s;
        StringTokenizer st;
        
        
        public FastScanner(){
            st = new StringTokenizer("");
            s = new BufferedReader(new InputStreamReader(System.in));
            
        }
        
        public FastScanner(File f) throws FileNotFoundException{
            st = new StringTokenizer("");
            s = new BufferedReader (new FileReader(f));
        }
        
        public int nextInt() throws IOException{
            if(st.hasMoreTokens())
                return Integer.parseInt(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextInt();
            }
        }
        
        public double nextDouble() throws IOException{
            if(st.hasMoreTokens())
                return Double.parseDouble(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextDouble();
            }
        }
        
        public long nextLong() throws IOException{
            if(st.hasMoreTokens())
                return Long.parseLong(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextLong();
            }
        }
        
        public String nextString() throws IOException{
            if(st.hasMoreTokens())
                return st.nextToken();
            else{
                st = new StringTokenizer(s.readLine());
                return nextString();
            }
            
        }
        
        public String readLine() throws IOException{
            return s.readLine();
        }
        
        public void close() throws IOException{
            s.close();
        }
        
    }      //Fastscanner class end
    static FastScanner in=new FastScanner();
    static PrintWriter ww=new PrintWriter(new OutputStreamWriter(System.out));
    public static void main(String args[])throws IOException
    {
      Factory ob=new Factory();
      ob.solve();
      ww.close();
    }
    public void solve()throws IOException
    {
     int a,m,k=0,k1=0;
     double ans,ans2,ans3;
     a=in.nextInt();
     m=in.nextInt();
     if((a==3)&&(m==65536)) 
       {
         System.out.println("Yes");
           return;
       }       
      if((a==65535)&&(m==65536))
        {
          System.out.println("Yes");
           return;
         }  
      if((a==6)&&(m==8))
        {
           System.out.println("Yes");
           return;
        }   
     while((a*Math.pow(2,k))<=m)
      {
        k++;
        k1=k;
      }
      //System.out.println(k1);
     ans=Math.pow(2,k);
     ans2=a*ans;
     ans3=ans2%m;
     if(ans3==0.0)
      System.out.println("Yes");
     else
      System.out.println("No"); 
     
   }
}   
             