description: You are given two positive integers x and y. You can perform the following operation with x: write it in its binary form without leading zeros, add 0 or 1 to the right of it, reverse the binary form and turn it into a decimal number which is assigned as the new value of x.
  
  For example: 
  
    * 34 can be turned into 81 via one operation: the binary form of 34 is 100010, if you add 1, reverse it and remove leading zeros, you will get 1010001, which is the binary form of 81. 
    * 34 can be turned into 17 via one operation: the binary form of 34 is 100010, if you add 0, reverse it and remove leading zeros, you will get 10001, which is the binary form of 17. 
    * 81 can be turned into 69 via one operation: the binary form of 81 is 1010001, if you add 0, reverse it and remove leading zeros, you will get 1000101, which is the binary form of 69. 
    * 34 can be turned into 69 via two operations: first you turn 34 into 81 and then 81 into 69. 
  
  
  
  Your task is to find out whether x can be turned into y after a certain number of operations (possibly zero).
  
  Input
  
  The only line of the input contains two integers x and y (1 ≤ x, y ≤ 10^{18}).
  
  Output
  
  Print YES if you can make x equal to y and NO if you can't.
  
  Examples
  
  Input
  
  
  3 3
  
  
  Output
  
  
  YES
  
  
  Input
  
  
  7 4
  
  
  Output
  
  
  NO
  
  
  Input
  
  
  2 8
  
  
  Output
  
  
  NO
  
  
  Input
  
  
  34 69
  
  
  Output
  
  
  YES
  
  
  Input
  
  
  8935891487501725 71487131900013807
  
  
  Output
  
  
  YES
  
  Note
  
  In the first example, you don't even need to do anything.
  
  The fourth example is described in the statement.
solution: import java.util.*;
  import java.io.*;
  
  ////***************************************************************************
   /* public class E_Gardener_and_Tree implements Runnable{
  
         public static void main(String[] args) throws Exception {
          new Thread(null, new E_Gardener_and_Tree(), "E_Gardener_and_Tree", 1<<28).start();
         }
      public void run(){
           WRITE YOUR CODE HERE!!!!
           JUST WRITE EVERYTHING HERE WHICH YOU WRITE IN MAIN!!!
         }
  
    }
  */
  /////**************************************************************************
  
  
  public class F_Reverse{
      public static void main(String[] args) {
          FastScanner s= new FastScanner();
          //PrintWriter out=new PrintWriter(System.out);
          //end of program
          //out.println(answer);
          //out.close();
          StringBuilder res = new StringBuilder();
  
          long x=s.nextLong();
          long y=s.nextLong();
          if(x==y){
              res.append("YES \n");
          }
          else if(y%2==0){
              res.append("NO \n");
          
          }
          else{
              long zeroes=0;
              long yo=x;
              while(yo%2==0){
                  long a=1;
                  yo=yo>>a;
                  zeroes++;
              }
              ArrayList<Long> list = new ArrayList<Long>();
              while(yo>0){
                  long a=1;
                  long bit=yo&a;
                  list.add(bit);
                  yo=yo>>a;
  
              }
              String well="";
              for(int i=list.size()-1;i>=0;i--){
                  long num=list.get(i);
                  well=well+num;
              }
              long yo2=y;
              ArrayList<Long> list2 = new ArrayList<Long>();
              while(yo2>0){
                  long a=1;
                  long bit=yo2&a;
                  list2.add(bit);
                  yo2=yo2>>a;
              }
              String nice1="";
              for(int i=0;i<list2.size();i++){
                  long num=list2.get(i);
                  nice1=nice1+num;
              }
              String nice2="";
              for(int i=list2.size()-1;i>=0;i--){
                  long num=list2.get(i);
                  nice2=nice2+num;
              }
              int size=well.length();
              int check1=0;
              // System.out.println("nice1 "+nice1);
              // System.out.println("nice2 "+nice2);
              {
                  for(int i=0;i<nice1.length();i++){
                      int end=Math.min((i+size),nice1.length());
                      String hh=nice1.substring(i,end);
                      if(well.equals(hh)){
                          int j=i+size;
                           int kk=0;
                           for(;j<nice1.length();j++){
                               char ch=nice1.charAt(j);
                               if(ch=='0'){
                                   kk++;
                               }
                               else{
                                   break;
                               }
                           }
                           if(kk==0 || kk==zeroes){
                               int flag1=0;
                               for(;j<nice1.length();j++){
                                  char ch=nice1.charAt(j);
                                   if(ch=='0'){
                                       flag1=1;
                                       break;
                                   }
                               }
                               int flag2=0;
                               for(int m=i-1;m>=0;m--){
                                  char ch=nice1.charAt(m);
                                  if(ch=='0'){
                                      flag2=1;
                                      break;
                                  }
                               }
                               if(flag1==0 && flag2==0){
                                   check1=1;
  
                               }
                           }
  
                      }
  
                  }
              }
  
              int check2=0;
              {
                  nice1=nice2;
                  ////
  
                  for(int i=0;i<nice1.length();i++){
                      int end=Math.min((i+size),nice1.length());
                      String hh=nice1.substring(i,end);
                      if(well.equals(hh)){
                          int j=i+size;
                           int kk=0;
                           for(;j<nice1.length();j++){
                               char ch=nice1.charAt(j);
                               if(ch=='0'){
                                   kk++;
                               }
                               else{
                                   break;
                               }
                           }
                           if(kk==0 || kk==zeroes){
                               int flag1=0;
                               for(;j<nice1.length();j++){
                                  char ch=nice1.charAt(j);
                                   if(ch=='0'){
                                       flag1=1;
                                       break;
                                   }
                               }
                               int flag2=0;
                               for(int m=i-1;m>=0;m--){
                                  char ch=nice1.charAt(m);
                                  if(ch=='0'){
                                      flag2=1;
                                      break;
                                  }
                               }
                               if(flag1==0 && flag2==0){
                                   check2=1;
  
                               }
                           }
  
                      }
  
                  }
  
  
  
                  ///
  
  
              }
              // System.out.println("check1 "+check1);
              // System.out.println("check2 "+check2);
              if(check1==1 || check2==1){
                  res.append("YES \n");
              }
              else{
                  res.append("NO \n");
              }
              
  
  
  
  
              
          }
          System.out.println(res);
      }
      static class FastScanner {
  		BufferedReader br;
  		StringTokenizer st;
   
  		public FastScanner(String s) {
  			try {
  				br = new BufferedReader(new FileReader(s));
  			} catch (FileNotFoundException e) {
  				// TODO Auto-generated catch block
  				e.printStackTrace();
  			}
  		}
   
  		public FastScanner() {
  			br = new BufferedReader(new InputStreamReader(System.in));
  		}
   
  		String nextToken() {
  			while (st == null || !st.hasMoreElements()) {
  				try {
  					st = new StringTokenizer(br.readLine());
  				} catch (IOException e) {
  					// TODO Auto-generated catch block
  					e.printStackTrace();
  				}
  			}
  			return st.nextToken();
  		}
   
  		int nextInt() {
  			return Integer.parseInt(nextToken());
  		}
   
  		long nextLong() {
  			return Long.parseLong(nextToken());
  		}
   
  		double nextDouble() {
  			return Double.parseDouble(nextToken());
  		}
  	}
  
  
      static long modpower(long x, long y, long p)
       {
        long res = 1; // Initialize result
     
        x = x % p; // Update x if it is more than or
        // equal to p
     
        if (x == 0)
          return 0; // In case x is divisible by p;
     
        while (y > 0)
        {
     
          // If y is odd, multiply x with result
          if ((y & 1) != 0)
            res = (res * x) % p;
     
          // y must be even now
          y = y >> 1; // y = y/2
          x = (x * x) % p;
        }
        return res;
      }
  
    
     // SIMPLE POWER FUNCTION=>
  
  
        static long power(long x, long y)
          {
              long res = 1;     // Initialize result
          
              while (y > 0)
              {
              
                  // If y is odd, multiply x with result
                  if ((y & 1) != 0)
                      res = res * x;
          
                  // y must be even now
                  y = y >> 1; // y = y/2
                  x = x * x;  // Change x to x^2
              }
              return res;
          }
  
  
  
  
  
  }