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 Omar {
  	static PrintWriter pw = new PrintWriter(System.out);
  	static Scanner sc = new Scanner(System.in);
  	public static boolean check(LinkedList<Integer> pos,LinkedList<Integer> pos2,int x) {
  		boolean ans=false;
      	for(int i=0;i<pos2.size();i++) {
      		if(pos2.get(i)>1) {
      			int c=0;
      			boolean kk=true;
      			while(c<pos.size() && i<pos2.size() && pos2.get(i)==pos.get(c)-x) {
      				c++;
      				i++;
      			}
      			kk&=c==pos.size();
      			while(i<pos2.size()) {
      				kk&=pos2.get(i)==1;
      				i++;
      			}
      			if(kk)ans=true;
      			break;
      		}
      		else {
      			boolean f=true;
      			boolean kk=true;
      			int k=i;
      			int c=0;
      			while(c<pos.size() && k<pos2.size() && (pos2.get(k)==pos.get(c)-x || f)) {
      				if(pos2.get(k)==pos.get(c)-x)c++;
      				if(pos2.get(k)>1)f=false;
      				k++;
      			}
      			
      			kk&=c==pos.size() ;
      			while(k<pos2.size()) {
      				kk&=pos2.get(k)==1;
      				k++;
      			}
      			if(kk) {
      				ans=true;
      				break;
      			}
      		}
      	}
      	return ans;
  	}
  	public static void main(String[] args) throws IOException {
  		    long x=sc.nextLong(),y=sc.nextLong();
          	LinkedList<Integer> pos=new LinkedList<>();
          	int prev=-1;
          	String ss=Long.toBinaryString(x);
          	String s="";
          	int a=ss.length()-1;
          	while(s.length()<ss.length())s+=ss.charAt(a--);
          	for(int i=0;i<s.length();i++) {
          		if(s.charAt(i)=='1') {
          			pos.add(i-prev);
          			prev=i;
          		}
          	}
          	LinkedList<Integer> pos2=new LinkedList<>();
          	prev=-1;
          	ss=Long.toBinaryString(y);
          	s="";
          	a=ss.length()-1;
          	while(s.length()<ss.length())s+=ss.charAt(a--);
          	for(int i=0;i<s.length();i++) {
          		if(s.charAt(i)=='1') {
          			pos2.add(i-prev);
          			prev=i;
          		}
          	}
          	long aa=x;
          	while(aa%2==0)aa>>=1;
          	ss=Long.toBinaryString(aa);
  //        	pw.println(ss);
          	LinkedList<Integer >tpos=new LinkedList<>();
          	prev=-1;
          	for(int i=0;i<ss.length();i++)
          		if(ss.charAt(i)=='1') {
          			tpos.add(i-prev);
          			prev=i;
          		}
          	int k=0;
          	if(s.charAt(0)=='0')k=pos.get(0)-1;
          	LinkedList<Integer> pp=new LinkedList<>(),ppp=new LinkedList<>();
          	for(int i=0;i<pos.size();i++)pp.addFirst(pos.get(i));
          	prev=-1;
          	for(int i=ss.length()-1,c=0;i>=0;i--,c++)if(ss.charAt(i)=='1') {
          		ppp.add(c-prev);
          		prev=c;
          	}
  //        	pw.println(pos2);
  //        	pw.println(pos);
  //        	pw.println(pp);
  //        	pw.println(ppp);
  //        	pw.println(tpos);
  //        	pw.println(Long.toBinaryString(x));
  //        	pw.println(Long.toBinaryString(y));
          	pw.println(x==y|| check(pos, pos2,k) || check(tpos, pos2,k) || check(pp, pos2, k) || check(ppp, pos2, k) ?"YES":"NO");
  		
  		pw.flush();
  	}
  
  	static class pair implements Comparable<pair> {
  		long x;
  		long y;
  
  		public pair(long x, long y) {
  			this.x = x;
  			this.y = y;
  		}
  
  		public String toString() {
  			return x + " " + y;
  		}
  
  		public boolean equals(Object o) {
  			if (o instanceof pair) {
  				pair p = (pair) o;
  				return p.x == x && p.y == y;
  			}
  			return false;
  		}
  
  		public int hashCode() {
  			return new Long(x).hashCode() * 31 + new Long(y).hashCode();
  		}
  
  		public int compareTo(pair other) {
  			if (this.x == other.x) {
  				return Long.compare(this.y, other.y);
  			}
  			return Long.compare(this.x, other.x);
  		}
  	}
  
  	static class tuble implements Comparable<tuble> {
  		int x;
  		int y;
  		int z;
  
  		public tuble(int x, int y, int z) {
  			this.x = x;
  			this.y = y;
  			this.z = z;
  		}
  
  		public String toString() {
  			return x + " " + y + " " + z;
  		}
  
  		public int compareTo(tuble other) {
  			if (this.x == other.x) {
  				if (this.y == other.y) {
  					return this.z - other.z;
  				}
  				return this.y - other.y;
  			} else {
  				return this.x - other.x;
  			}
  		}
  	}
  
  	static class Scanner {
  		StringTokenizer st;
  		BufferedReader br;
  
  		public Scanner(InputStream s) {
  			br = new BufferedReader(new InputStreamReader(s));
  		}
  
  		public Scanner(String file) throws IOException {
  			br = new BufferedReader(new FileReader(file));
  		}
  
  		public Scanner(FileReader r) {
  			br = new BufferedReader(r);
  		}
  
  		public String next() throws IOException {
  			while (st == null || !st.hasMoreTokens())
  				st = new StringTokenizer(br.readLine());
  			return st.nextToken();
  		}
  
  		public String readAllLines(BufferedReader reader) throws IOException {
  			StringBuilder content = new StringBuilder();
  			String line;
  
  			while ((line = reader.readLine()) != null) {
  				content.append(line);
  				content.append(System.lineSeparator());
  			}
  
  			return content.toString();
  		}
  
  		public int nextInt() throws IOException {
  			return Integer.parseInt(next());
  		}
  
  		public long nextLong() throws IOException {
  			return Long.parseLong(next());
  		}
  
  		public String nextLine() throws IOException {
  			return br.readLine();
  		}
  
  		public double nextDouble() throws IOException {
  			String x = next();
  			StringBuilder sb = new StringBuilder("0");
  			double res = 0, f = 1;
  			boolean dec = false, neg = false;
  			int start = 0;
  			if (x.charAt(0) == '-') {
  				neg = true;
  				start++;
  			}
  			for (int i = start; i < x.length(); i++)
  				if (x.charAt(i) == '.') {
  					res = Long.parseLong(sb.toString());
  					sb = new StringBuilder("0");
  					dec = true;
  				} else {
  					sb.append(x.charAt(i));
  					if (dec)
  						f *= 10;
  				}
  			res += Long.parseLong(sb.toString()) / f;
  			return res * (neg ? -1 : 1);
  		}
  
  		public long[] nextlongArray(int n) throws IOException {
  			long[] a = new long[n];
  			for (int i = 0; i < n; i++)
  				a[i] = nextLong();
  			return a;
  		}
  
  		public Long[] nextLongArray(int n) throws IOException {
  			Long[] a = new Long[n];
  			for (int i = 0; i < n; i++)
  				a[i] = nextLong();
  			return a;
  		}
  
  		public int[] nextIntArray(int n) throws IOException {
  			int[] a = new int[n];
  			for (int i = 0; i < n; i++)
  				a[i] = nextInt();
  			return a;
  		}
  
  		public Integer[] nextIntegerArray(int n) throws IOException {
  			Integer[] a = new Integer[n];
  			for (int i = 0; i < n; i++)
  				a[i] = nextInt();
  			return a;
  		}
  
  		public boolean ready() throws IOException {
  			return br.ready();
  		}
  
  	}
  
  }
  