At first, let's define function f(x) as follows: $$$ \begin{matrix} f(x) & = & \left\{ \begin{matrix} x/2 & \mbox{if } x  is even \\\ x - 1 & \mbox{otherwise } \end{matrix} \right. \end{matrix} $$$

We can see that if we choose some value v and will apply function f to it, then apply f to f(v), and so on, we'll eventually get 1. Let's write down all values we get in this process in a list and denote this list as path(v). For example, path(1) = [1], path(15) = [15, 14, 7, 6, 3, 2, 1], path(32) = [32, 16, 8, 4, 2, 1].

Let's write all lists path(x) for every x from 1 to n. The question is next: what is the maximum value y such that y is contained in at least k different lists path(x)?

Formally speaking, you need to find maximum y such that \left| \{ x ~|~ 1 ≤ x ≤ n, y ∈ path(x) \} \right| ≥ k.

Input

The first line contains two integers n and k (1 ≤ k ≤ n ≤ 10^{18}).

Output

Print the only integer — the maximum value that is contained in at least k paths.

Examples

Input


11 3


Output


5


Input


11 6


Output


4


Input


20 20


Output


1


Input


14 5


Output


6


Input


1000000 100


Output


31248

Note

In the first example, the answer is 5, since 5 occurs in path(5), path(10) and path(11).

In the second example, the answer is 4, since 4 occurs in path(4), path(5), path(8), path(9), path(10) and path(11).

In the third example n = k, so the answer is 1, since 1 is the only number occuring in all paths for integers from 1 to 20.
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;


import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.Random;
import java.util.TreeSet;

public final class CF_608_D2_E
{


	static boolean verb=true;
	static void log(Object X){if (verb) System.err.println(X);}
	static void log(Object[] X){if (verb) {for (Object U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X){if (verb) {for (int U:X) System.err.print(U+" ");System.err.println("");}}
	static void log(int[] X,int L){if (verb) {for (int i=0;i<L;i++) System.err.print(X[i]+" ");System.err.println("");}}
	static void log(long[] X){if (verb) {for (long U:X) System.err.print(U+" ");System.err.println("");}}

	static void logWln(Object X){if (verb) System.err.print(X);}
	static void info(Object o){	System.out.println(o);}
	static void output(Object o){outputWln(""+o+"\n");	}
	static void outputWln(Object o){try {out.write(""+ o);} catch (Exception e) {}}













	// Global vars
	static BufferedWriter out;
	static InputReader reader;


	static void explore(int x,int[] cnt) {
		cnt[x]++;
		if (x==1)
			return;
		if (x%2==0)
			explore(x/2,cnt);
		else
			explore(x-1,cnt);
	}

	static long solveBourrin(int n,int k) {

		int[] cnt=new int[n+1];
		for (int x=1;x<=n;x++) {
			explore(x,cnt);
		}
		int ans=1;
		for (int x=1;x<=n;x++) {
			if (cnt[x]>=k)
				ans=x;
		}

		return ans;
	}


	


	static void test() {
		log("testing");

		Random r=new Random();
		for (int n=1;n<=1000;n++) {
			for (int k=1;k<=n;k++) {
				long x1=solveBourrin(n,k);
				long x2=solveSubtil(n,k);
				if (x1!=x2) {
					log("Error");
					log(n+" "+k);
					log(x1+" "+x2);
				}
			}
		}

		log("done");

	}

	static void testDirect() {
		log("test Direct");
		for (int n=1;n<=10000;n++) {
			int[] cnt=new int[n+1];
			for (int x=1;x<=n;x++) {
				explore(x,cnt);
			}

			for (int x=1;x<=n;x++) {
				long a=cnt[x];
				long b=findDirect(x,n);
				if (a!=b) {
					log("Error");
					log(x+" "+n);
					log(a+" vs "+b);
					return;
				}
			}
		}
		log("done");
	}


	static void testRec2() {
		log("test Rec2");
		for (int n=1;n<=100;n++) {
			int[] cnt=new int[n+1];
			for (int x=1;x<=n;x++) {
				explore(x,cnt);
			}

			for (int x=1;x<=n;x++) {
				long a=cnt[x];
				long b=findRec2(x,n);
				if (a!=b) {
					log("Error");
					log(x+" "+n);
					log(a+" vs "+b);
					return;
				}
			}
		}
		log("done");
	}

	static HashMap<Long,Long> cache;

	static long findRec(long x,long n) {
		Long z=cache.get(x);
		if (z!=null)
			return z;
		long ans=1;


		if (x*2<=n)
			ans+=findRec(2*x,n);

		if (x%2==0 && x+1<=n)
			ans+=findRec(x+1,n);
		//log("x:"+x+" ans:"+ans);
		cache.put(x,ans);
		return ans;
	}


	// number of y such that x is prefix of y, under n
	static long numPre(long x,long n) {
		String sn=Long.toBinaryString(n);
		String sx=Long.toBinaryString(x);
		int A=Long.toBinaryString(x).length();
		int B=sn.length();
		long ans=0;
	
		if (A+1<B) {
			// we can put whater we want, B-A-1
			long delta=(1L<<(B-A))-1;
			//log("adding:"+delta);
			ans+=delta;
		}
		long mult=1L<<(B-A);
		if (x<=n/mult) {
			boolean ok=false;
			for (int i=0;i<A;i++) {
				if (sn.charAt(i)>sx.charAt(i))
					ok=true;
			}
			if (ok==true) {
				ans+=mult;
				//log("adding mult:"+mult);
			} else {
				char[] c=new char[B];
				for (int i=0;i<A;i++)
					c[i]=sx.charAt(i);
				for (int i=A;i<B;i++)
					c[i]=sn.charAt(i);
				long y=Long.parseLong(new String(c),2);
				ans+=y-(x*mult)+1;
				//log("addint y-x+1:"+(y-(x*mult)+1));
			}
			
		}
		if (mult>1 && A+1>=B)
			ans++;
		return ans;
	}

	static void testNumPre() {
		log("testing numPre");
		
		for (int n=1;n<=100;n++) {
			for (int x=1;x<=n;x++) {
				int cnt=0;
				for (int y=x;y<=n;y++) {
					int z=y;
					while (z>x)
						z/=2;
					if (z==x)
						cnt++;
				}
				log("---------");
				long op=numPre(x,n);
				if (cnt!=op) {
					log("Error");
					log(x+" "+n);
					log(cnt+" "+op);
					return;
				}
			}
		}
		log("done");
	}
	
	static long findDirect(long x,long n) {
		if (x%2==0) {
			return numPre(x,n)+numPre(x+1,n);
		}
		return numPre(x,n);



	}

	static long findRec2(long x,long n) {
		long ans=1;
		if (x%2==0) {
			if (x+1<=n)
				ans+=findRec2(x+1,n);
		} 
		if (2*x<=n)
			ans+=findRec2(2*x,n);
		//log("x:"+x+" ans:"+ans);
		return ans;
	}



	static long solveSubtil(long n,long k) {

		long ans;

		if (k==1)
			ans=n;
		else {

			long lo=1;
			long hi=n;
			if (hi%2==1) 
				hi--;
			if (hi!=n && findDirect(hi,n)>=k) {
				ans=hi;
			} else {
				while (lo+2<hi) {
					long mid=(lo+hi)/2;

					if (mid%2==1 && mid+1<=n)
						mid++;
					long val=findDirect(mid,n);
					if (val>=k) 
						lo=mid;
					else
						hi=mid;
				}
				//log("lo:"+lo+" hi:"+hi);
				ans=lo;
				for (long x=lo+1;x<=hi;x++) {
					if (findDirect(x,n)>=k)
						ans=x;
				}
			}
		}
		return ans;

	}

	static void process() throws Exception {


		//testDirect();
		out = new BufferedWriter(new OutputStreamWriter(System.out));
		reader = new InputReader(System.in);

		cache=new HashMap<Long,Long>();

		//test();

		long n=reader.readLong();
		long k=reader.readLong();



		output(solveSubtil(n,k));

		try {
			out.close();
		} catch (Exception e) {
		}

	}





	public static void main(String[] args) throws Exception {
		process();

	}

	static final class InputReader {
		private final InputStream stream;
		private final byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;

		public InputReader(InputStream stream) {
			this.stream = stream;
		}

		private int read() throws IOException {
			if (curChar >= numChars) {
				curChar = 0;
				numChars = stream.read(buf);
				if (numChars <= 0) {
					return -1;
				}
			}
			return buf[curChar++];
		}

		public final String readString() throws IOException {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder();
			do {
				res.append((char) c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public final String readString(int L) throws IOException {
			int c = read();
			while (isSpaceChar(c)) {
				c = read();
			}
			StringBuilder res = new StringBuilder(L);
			do {
				res.append((char) c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public final int readInt() throws IOException {
			int c = read();
			boolean neg = false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d = (char) c;
			// log("d:"+d);
			if (d == '-') {
				neg = true;
				c = read();
			}
			int res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			// log("res:"+res);
			if (neg)
				return -res;
			return res;

		}

		public final long readLong() throws IOException {
			int c = read();
			boolean neg = false;
			while (isSpaceChar(c)) {
				c = read();
			}
			char d = (char) c;
			// log("d:"+d);
			if (d == '-') {
				neg = true;
				c = read();
			}
			long res = 0;
			do {
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			// log("res:"+res);
			if (neg)
				return -res;
			return res;

		}

		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}
	}

}